Fix fallout from deny(unused_lifetimes)
.
This commit is contained in:
parent
37799a5552
commit
2441253508
@ -30,7 +30,7 @@ struct LoopScope {
|
||||
break_index: CFGIndex, // where to go on a `break`
|
||||
}
|
||||
|
||||
pub fn construct<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
pub fn construct<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
body: &hir::Body) -> CFG {
|
||||
let mut graph = graph::Graph::new();
|
||||
let entry = graph.add_node(CFGNodeData::Entry);
|
||||
|
@ -49,7 +49,7 @@ pub type CFGNode = graph::Node<CFGNodeData>;
|
||||
pub type CFGEdge = graph::Edge<CFGEdgeData>;
|
||||
|
||||
impl CFG {
|
||||
pub fn new<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
pub fn new<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
body: &hir::Body) -> CFG {
|
||||
construct::construct(tcx, body)
|
||||
}
|
||||
|
@ -842,7 +842,7 @@ impl DepGraph {
|
||||
//
|
||||
// This method will only load queries that will end up in the disk cache.
|
||||
// Other queries will not be executed.
|
||||
pub fn exec_cache_promotions<'a, 'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn exec_cache_promotions<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
let green_nodes: Vec<DepNode> = {
|
||||
let data = self.data.as_ref().unwrap();
|
||||
data.colors.values.indices().filter_map(|prev_index| {
|
||||
|
@ -33,7 +33,7 @@ impl DepGraphSafe for DefId {
|
||||
|
||||
/// The type context itself can be used to access all kinds of tracked
|
||||
/// state, but those accesses should always generate read events.
|
||||
impl<'a, 'gcx, 'tcx> DepGraphSafe for TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> DepGraphSafe for TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
}
|
||||
|
||||
/// Tuples make it easy to build up state.
|
||||
|
@ -478,7 +478,7 @@ impl<'tcx> CanonicalVarValues<'tcx> {
|
||||
/// `self.var_values == [Type(u32), Lifetime('a), Type(u64)]`
|
||||
/// we'll return a substitution `subst` with:
|
||||
/// `subst.var_values == [Type(^0), Lifetime(^1), Type(^2)]`.
|
||||
pub fn make_identity<'a>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Self {
|
||||
pub fn make_identity(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Self {
|
||||
use crate::ty::subst::UnpackedKind;
|
||||
|
||||
CanonicalVarValues {
|
||||
|
@ -67,7 +67,7 @@ mod need_type_info;
|
||||
|
||||
pub mod nice_region_error;
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
pub fn note_and_explain_region(
|
||||
self,
|
||||
region_scope_tree: ®ion::ScopeTree,
|
||||
|
@ -1624,7 +1624,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for ShallowResolver<'a, 'gcx, 'tcx>
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TypeTrace<'tcx> {
|
||||
impl<'gcx, 'tcx> TypeTrace<'tcx> {
|
||||
pub fn span(&self) -> Span {
|
||||
self.cause.span
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ impl<'tcx> FreeRegionMap<'tcx> {
|
||||
/// cases, this is more conservative than necessary, in order to
|
||||
/// avoid making arbitrary choices. See
|
||||
/// `TransitiveRelation::postdom_upper_bound` for more details.
|
||||
pub fn lub_free_regions<'a, 'gcx>(&self,
|
||||
pub fn lub_free_regions<'gcx>(&self,
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
r_a: Region<'tcx>,
|
||||
r_b: Region<'tcx>)
|
||||
@ -90,7 +90,7 @@ impl_stable_hash_for!(struct FreeRegionMap<'tcx> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for FreeRegionMap<'a> {
|
||||
type Lifted = FreeRegionMap<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<FreeRegionMap<'tcx>> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<FreeRegionMap<'tcx>> {
|
||||
self.relation.maybe_map(|&fr| tcx.lift(&fr))
|
||||
.map(|relation| FreeRegionMap { relation })
|
||||
}
|
||||
|
@ -849,7 +849,7 @@ impl<'tcx> fmt::Display for GenericKind<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> GenericKind<'tcx> {
|
||||
impl<'gcx, 'tcx> GenericKind<'tcx> {
|
||||
pub fn to_ty(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
|
||||
match *self {
|
||||
GenericKind::Param(ref p) => p.to_ty(tcx),
|
||||
|
@ -10,7 +10,7 @@ use std::marker::PhantomData;
|
||||
use std::cell::RefMut;
|
||||
|
||||
pub trait ToType {
|
||||
fn to_type<'a, 'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx>;
|
||||
fn to_type<'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx>;
|
||||
}
|
||||
|
||||
impl UnifyKey for ty::IntVid {
|
||||
@ -52,7 +52,7 @@ impl UnifyKey for ty::RegionVid {
|
||||
}
|
||||
|
||||
impl ToType for IntVarValue {
|
||||
fn to_type<'a, 'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
|
||||
fn to_type<'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
|
||||
match *self {
|
||||
ty::IntType(i) => tcx.mk_mach_int(i),
|
||||
ty::UintType(i) => tcx.mk_mach_uint(i),
|
||||
@ -72,7 +72,7 @@ impl UnifyKey for ty::FloatVid {
|
||||
impl EqUnifyValue for FloatVarValue {}
|
||||
|
||||
impl ToType for FloatVarValue {
|
||||
fn to_type<'a, 'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
|
||||
fn to_type<'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
|
||||
tcx.mk_mach_float(self.0)
|
||||
}
|
||||
}
|
||||
|
@ -766,7 +766,7 @@ pub fn maybe_lint_level_root(tcx: TyCtxt<'_, '_, '_>, id: hir::HirId) -> bool {
|
||||
attrs.iter().any(|attr| Level::from_symbol(attr.name_or_empty()).is_some())
|
||||
}
|
||||
|
||||
fn lint_levels<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, cnum: CrateNum)
|
||||
fn lint_levels<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, cnum: CrateNum)
|
||||
-> &'tcx LintLevelMap
|
||||
{
|
||||
assert_eq!(cnum, LOCAL_CRATE);
|
||||
|
@ -264,7 +264,7 @@ macro_rules! BraceStructLiftImpl {
|
||||
{
|
||||
type Lifted = $lifted;
|
||||
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<$lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<$lifted> {
|
||||
$(let $field = tcx.lift(&self.$field)?;)*
|
||||
Some(Self::Lifted { $($field),* })
|
||||
}
|
||||
@ -283,7 +283,7 @@ macro_rules! EnumLiftImpl {
|
||||
{
|
||||
type Lifted = $lifted;
|
||||
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<$lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<$lifted> {
|
||||
EnumLiftImpl!(@Variants(self, tcx) input($($variants)*) output())
|
||||
}
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ pub trait CrateStore {
|
||||
fn crates_untracked(&self) -> Vec<CrateNum>;
|
||||
|
||||
// utility functions
|
||||
fn encode_metadata<'a, 'tcx>(&self,
|
||||
fn encode_metadata<'tcx>(&self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>)
|
||||
-> EncodedMetadata;
|
||||
fn metadata_encoding_version(&self) -> &[u8];
|
||||
|
@ -26,7 +26,7 @@ use syntax_pos;
|
||||
// explored. For example, if it's a live Node::Item that is a
|
||||
// function, then we should explore its block to check for codes that
|
||||
// may need to be marked as live.
|
||||
fn should_explore<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn should_explore<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
hir_id: hir::HirId) -> bool {
|
||||
match tcx.hir().find_by_hir_id(hir_id) {
|
||||
Some(Node::Item(..)) |
|
||||
@ -423,7 +423,7 @@ impl<'v, 'k, 'tcx> ItemLikeVisitor<'v> for LifeSeeder<'k, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn create_and_seed_worklist<'a, 'tcx>(
|
||||
fn create_and_seed_worklist<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
access_levels: &privacy::AccessLevels,
|
||||
krate: &hir::Crate,
|
||||
@ -451,7 +451,7 @@ fn create_and_seed_worklist<'a, 'tcx>(
|
||||
(life_seeder.worklist, life_seeder.struct_constructors)
|
||||
}
|
||||
|
||||
fn find_live<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn find_live<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
access_levels: &privacy::AccessLevels,
|
||||
krate: &hir::Crate)
|
||||
-> FxHashSet<hir::HirId> {
|
||||
@ -660,7 +660,7 @@ impl Visitor<'tcx> for DeadVisitor<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn check_crate<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
let access_levels = &tcx.privacy_access_levels(LOCAL_CRATE);
|
||||
let krate = tcx.hir().krate();
|
||||
let live_symbols = find_live(tcx, access_levels, krate);
|
||||
|
@ -81,7 +81,7 @@ pub enum Linkage {
|
||||
Dynamic,
|
||||
}
|
||||
|
||||
pub fn calculate<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn calculate<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
let sess = &tcx.sess;
|
||||
let fmts = sess.crate_types.borrow().iter().map(|&ty| {
|
||||
let linkage = calculate_type(tcx, ty);
|
||||
@ -92,7 +92,7 @@ pub fn calculate<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
sess.dependency_formats.set(fmts);
|
||||
}
|
||||
|
||||
fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn calculate_type<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
ty: config::CrateType) -> DependencyList {
|
||||
|
||||
let sess = &tcx.sess;
|
||||
@ -267,7 +267,7 @@ fn add_library(tcx: TyCtxt<'_, '_, '_>,
|
||||
}
|
||||
}
|
||||
|
||||
fn attempt_static<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Option<DependencyList> {
|
||||
fn attempt_static<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Option<DependencyList> {
|
||||
let sess = &tcx.sess;
|
||||
let crates = cstore::used_crates(tcx, RequireStatic);
|
||||
if !crates.iter().by_ref().all(|&(_, ref p)| p.is_some()) {
|
||||
@ -324,7 +324,7 @@ fn activate_injected_dep(injected: Option<CrateNum>,
|
||||
|
||||
// After the linkage for a crate has been determined we need to verify that
|
||||
// there's only going to be one allocator in the output.
|
||||
fn verify_ok<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, list: &[Linkage]) {
|
||||
fn verify_ok<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, list: &[Linkage]) {
|
||||
let sess = &tcx.sess;
|
||||
if list.len() == 0 {
|
||||
return
|
||||
|
@ -36,7 +36,7 @@ struct ExprVisitor<'tcx> {
|
||||
|
||||
/// If the type is `Option<T>`, it will return `T`, otherwise
|
||||
/// the type itself. Works on most `Option`-like types.
|
||||
fn unpack_option_like<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn unpack_option_like<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
ty: Ty<'tcx>)
|
||||
-> Ty<'tcx> {
|
||||
let (def, substs) = match ty.sty {
|
||||
|
@ -217,7 +217,7 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<(Symbol, Span)> {
|
||||
}
|
||||
|
||||
/// Traverse and collect all the lang items in all crates.
|
||||
pub fn collect<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> LanguageItems {
|
||||
pub fn collect<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> LanguageItems {
|
||||
// Initialize the collector.
|
||||
let mut collector = LanguageItemCollector::new(tcx);
|
||||
|
||||
@ -402,7 +402,7 @@ language_item_table! {
|
||||
Rc, "rc", rc, Target::Struct;
|
||||
}
|
||||
|
||||
impl<'a, 'tcx, 'gcx> TyCtxt<'gcx, 'tcx, 'gcx> {
|
||||
impl<'tcx, 'gcx> TyCtxt<'gcx, 'tcx, 'gcx> {
|
||||
/// Returns the `DefId` for a given `LangItem`.
|
||||
/// If not found, fatally abort compilation.
|
||||
pub fn require_lang_item(&self, lang_item: LangItem) -> DefId {
|
||||
|
@ -142,7 +142,7 @@ impl Visitor<'tcx> for LibFeatureCollector<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn collect<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> LibFeatures {
|
||||
pub fn collect<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> LibFeatures {
|
||||
let mut collector = LibFeatureCollector::new(tcx);
|
||||
intravisit::walk_crate(&mut collector, tcx.hir().krate());
|
||||
collector.lib_features
|
||||
|
@ -166,7 +166,7 @@ fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt<'_, '_, '_>) -> Strin
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Visitor<'tcx> for IrMaps<'tcx> {
|
||||
impl<'tcx> Visitor<'tcx> for IrMaps<'tcx> {
|
||||
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
|
||||
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
|
||||
}
|
||||
@ -411,7 +411,7 @@ fn visit_fn<'a, 'tcx: 'a>(ir: &mut IrMaps<'tcx>,
|
||||
lsets.warn_about_unused_args(body, entry_ln);
|
||||
}
|
||||
|
||||
fn add_from_pat<'a, 'tcx>(ir: &mut IrMaps<'tcx>, pat: &P<hir::Pat>) {
|
||||
fn add_from_pat<'tcx>(ir: &mut IrMaps<'tcx>, pat: &P<hir::Pat>) {
|
||||
// For struct patterns, take note of which fields used shorthand
|
||||
// (`x` rather than `x: x`).
|
||||
let mut shorthand_field_ids = HirIdSet::default();
|
||||
@ -457,19 +457,19 @@ fn add_from_pat<'a, 'tcx>(ir: &mut IrMaps<'tcx>, pat: &P<hir::Pat>) {
|
||||
});
|
||||
}
|
||||
|
||||
fn visit_local<'a, 'tcx>(ir: &mut IrMaps<'tcx>, local: &'tcx hir::Local) {
|
||||
fn visit_local<'tcx>(ir: &mut IrMaps<'tcx>, local: &'tcx hir::Local) {
|
||||
add_from_pat(ir, &local.pat);
|
||||
intravisit::walk_local(ir, local);
|
||||
}
|
||||
|
||||
fn visit_arm<'a, 'tcx>(ir: &mut IrMaps<'tcx>, arm: &'tcx hir::Arm) {
|
||||
fn visit_arm<'tcx>(ir: &mut IrMaps<'tcx>, arm: &'tcx hir::Arm) {
|
||||
for pat in &arm.pats {
|
||||
add_from_pat(ir, pat);
|
||||
}
|
||||
intravisit::walk_arm(ir, arm);
|
||||
}
|
||||
|
||||
fn visit_expr<'a, 'tcx>(ir: &mut IrMaps<'tcx>, expr: &'tcx Expr) {
|
||||
fn visit_expr<'tcx>(ir: &mut IrMaps<'tcx>, expr: &'tcx Expr) {
|
||||
match expr.node {
|
||||
// live nodes required for uses or definitions of variables:
|
||||
hir::ExprKind::Path(hir::QPath::Resolved(_, ref path)) => {
|
||||
|
@ -44,7 +44,7 @@ fn item_might_be_inlined(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
}
|
||||
}
|
||||
|
||||
fn method_might_be_inlined<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn method_might_be_inlined<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
impl_item: &hir::ImplItem,
|
||||
impl_src: DefId) -> bool {
|
||||
let codegen_fn_attrs = tcx.codegen_fn_attrs(impl_item.hir_id.owner_def_id());
|
||||
@ -391,7 +391,7 @@ impl<'a, 'tcx: 'a> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a,
|
||||
#[derive(Clone, HashStable)]
|
||||
pub struct ReachableSet(pub Lrc<HirIdSet>);
|
||||
|
||||
fn reachable_set<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, crate_num: CrateNum) -> ReachableSet {
|
||||
fn reachable_set<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, crate_num: CrateNum) -> ReachableSet {
|
||||
debug_assert!(crate_num == LOCAL_CRATE);
|
||||
|
||||
let access_levels = &tcx.privacy_access_levels(LOCAL_CRATE);
|
||||
|
@ -646,7 +646,7 @@ impl<'tcx> ScopeTree {
|
||||
|
||||
/// Assuming that the provided region was defined within this `ScopeTree`,
|
||||
/// returns the outermost `Scope` that the region outlives.
|
||||
pub fn early_free_scope<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
pub fn early_free_scope<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
br: &ty::EarlyBoundRegion)
|
||||
-> Scope {
|
||||
let param_owner = tcx.parent(br.def_id).unwrap();
|
||||
@ -677,7 +677,7 @@ impl<'tcx> ScopeTree {
|
||||
|
||||
/// Assuming that the provided region was defined within this `ScopeTree`,
|
||||
/// returns the outermost `Scope` that the region outlives.
|
||||
pub fn free_scope<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>, fr: &ty::FreeRegion)
|
||||
pub fn free_scope<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>, fr: &ty::FreeRegion)
|
||||
-> Scope {
|
||||
let param_owner = match fr.bound_region {
|
||||
ty::BoundRegion::BrNamed(def_id, _) => {
|
||||
@ -748,7 +748,7 @@ fn record_var_lifetime(visitor: &mut RegionResolutionVisitor<'_>,
|
||||
}
|
||||
}
|
||||
|
||||
fn resolve_block<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'tcx hir::Block) {
|
||||
fn resolve_block<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'tcx hir::Block) {
|
||||
debug!("resolve_block(blk.hir_id={:?})", blk.hir_id);
|
||||
|
||||
let prev_cx = visitor.cx;
|
||||
@ -816,7 +816,7 @@ fn resolve_block<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'t
|
||||
visitor.cx = prev_cx;
|
||||
}
|
||||
|
||||
fn resolve_arm<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, arm: &'tcx hir::Arm) {
|
||||
fn resolve_arm<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, arm: &'tcx hir::Arm) {
|
||||
let prev_cx = visitor.cx;
|
||||
|
||||
visitor.enter_scope(
|
||||
@ -838,7 +838,7 @@ fn resolve_arm<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, arm: &'tcx
|
||||
visitor.cx = prev_cx;
|
||||
}
|
||||
|
||||
fn resolve_pat<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, pat: &'tcx hir::Pat) {
|
||||
fn resolve_pat<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, pat: &'tcx hir::Pat) {
|
||||
visitor.record_child_scope(Scope { id: pat.hir_id.local_id, data: ScopeData::Node });
|
||||
|
||||
// If this is a binding then record the lifetime of that binding.
|
||||
@ -855,7 +855,7 @@ fn resolve_pat<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, pat: &'tcx
|
||||
debug!("resolve_pat - post-increment {} pat = {:?}", visitor.expr_and_pat_count, pat);
|
||||
}
|
||||
|
||||
fn resolve_stmt<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, stmt: &'tcx hir::Stmt) {
|
||||
fn resolve_stmt<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, stmt: &'tcx hir::Stmt) {
|
||||
let stmt_id = stmt.hir_id.local_id;
|
||||
debug!("resolve_stmt(stmt.id={:?})", stmt_id);
|
||||
|
||||
@ -874,7 +874,7 @@ fn resolve_stmt<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, stmt: &'t
|
||||
visitor.cx.parent = prev_parent;
|
||||
}
|
||||
|
||||
fn resolve_expr<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx hir::Expr) {
|
||||
fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx hir::Expr) {
|
||||
debug!("resolve_expr - pre-increment {} expr = {:?}", visitor.expr_and_pat_count, expr);
|
||||
|
||||
let prev_cx = visitor.cx;
|
||||
@ -977,7 +977,7 @@ fn resolve_expr<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'t
|
||||
visitor.cx = prev_cx;
|
||||
}
|
||||
|
||||
fn resolve_local<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>,
|
||||
fn resolve_local<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>,
|
||||
pat: Option<&'tcx hir::Pat>,
|
||||
init: Option<&'tcx hir::Expr>) {
|
||||
debug!("resolve_local(pat={:?}, init={:?})", pat, init);
|
||||
@ -1127,7 +1127,7 @@ fn resolve_local<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>,
|
||||
/// | box E&
|
||||
/// | E& as ...
|
||||
/// | ( E& )
|
||||
fn record_rvalue_scope_if_borrow_expr<'a, 'tcx>(
|
||||
fn record_rvalue_scope_if_borrow_expr<'tcx>(
|
||||
visitor: &mut RegionResolutionVisitor<'tcx>,
|
||||
expr: &hir::Expr,
|
||||
blk_id: Option<Scope>)
|
||||
@ -1178,7 +1178,7 @@ fn resolve_local<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>,
|
||||
/// | <rvalue>
|
||||
///
|
||||
/// Note: ET is intended to match "rvalues or places based on rvalues".
|
||||
fn record_rvalue_scope<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>,
|
||||
fn record_rvalue_scope<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>,
|
||||
expr: &hir::Expr,
|
||||
blk_scope: Option<Scope>) {
|
||||
let mut expr = expr;
|
||||
@ -1205,7 +1205,7 @@ fn resolve_local<'a, 'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>,
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> RegionResolutionVisitor<'tcx> {
|
||||
impl<'tcx> RegionResolutionVisitor<'tcx> {
|
||||
/// Records the current parent (if any) as the parent of `child_scope`.
|
||||
/// Returns the depth of `child_scope`.
|
||||
fn record_child_scope(&mut self, child_scope: Scope) -> ScopeDepth {
|
||||
@ -1235,7 +1235,7 @@ impl<'a, 'tcx> RegionResolutionVisitor<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
|
||||
impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
|
||||
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
|
||||
NestedVisitorMap::None
|
||||
}
|
||||
@ -1327,7 +1327,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn region_scope_tree<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId)
|
||||
fn region_scope_tree<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId)
|
||||
-> &'tcx ScopeTree
|
||||
{
|
||||
let closure_base_def_id = tcx.closure_base_def_id(def_id);
|
||||
|
@ -389,7 +389,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Index<'tcx> {
|
||||
impl<'tcx> Index<'tcx> {
|
||||
pub fn new(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Index<'tcx> {
|
||||
let is_staged_api =
|
||||
tcx.sess.opts.debugging_opts.force_unstable_if_unmarked ||
|
||||
@ -521,7 +521,7 @@ pub enum EvalResult {
|
||||
Unmarked,
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
// See issue #38412.
|
||||
fn skip_stability_check_due_to_privacy(self, mut def_id: DefId) -> bool {
|
||||
// Check if `def_id` is a trait method.
|
||||
@ -827,7 +827,7 @@ impl Visitor<'tcx> for Checker<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
pub fn lookup_deprecation(self, id: DefId) -> Option<Deprecation> {
|
||||
self.lookup_deprecation_entry(id).map(|depr| depr.attr)
|
||||
}
|
||||
@ -836,7 +836,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
/// Given the list of enabled features that were not language features (i.e., that
|
||||
/// were expected to be library features), and the list of features used from
|
||||
/// libraries, identify activated features that don't exist and error about them.
|
||||
pub fn check_unused_or_stable_features<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn check_unused_or_stable_features<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
let access_levels = &tcx.privacy_access_levels(LOCAL_CRATE);
|
||||
|
||||
if tcx.stability().staged_api[&LOCAL_CRATE] {
|
||||
@ -920,7 +920,7 @@ pub fn check_unused_or_stable_features<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>)
|
||||
// don't lint about unused features. We should reenable this one day!
|
||||
}
|
||||
|
||||
fn unnecessary_stable_feature_lint<'a, 'tcx>(
|
||||
fn unnecessary_stable_feature_lint<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
span: Span,
|
||||
feature: Symbol,
|
||||
|
@ -24,7 +24,7 @@ struct Context<'a, 'tcx: 'a> {
|
||||
|
||||
/// Checks the crate for usage of weak lang items, returning a vector of all the
|
||||
/// language items required by this crate, but not defined yet.
|
||||
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
pub fn check_crate<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
items: &mut lang_items::LanguageItems) {
|
||||
// These are never called by user code, they're generated by the compiler.
|
||||
// They will never implicitly be added to the `missing` array unless we do
|
||||
@ -72,7 +72,7 @@ pub fn whitelisted(tcx: TyCtxt<'_, '_, '_>, lang_item: lang_items::LangItem) ->
|
||||
false
|
||||
}
|
||||
|
||||
fn verify<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn verify<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
items: &lang_items::LanguageItems) {
|
||||
// We only need to check for the presence of weak lang items if we're
|
||||
// emitting something that's not an rlib.
|
||||
@ -142,7 +142,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx, 'gcx> TyCtxt<'gcx, 'tcx, 'gcx> {
|
||||
impl<'tcx, 'gcx> TyCtxt<'gcx, 'tcx, 'gcx> {
|
||||
pub fn is_weak_lang_item(&self, item_def_id: DefId) -> bool {
|
||||
let lang_items = self.lang_items();
|
||||
let did = Some(item_def_id);
|
||||
|
@ -74,7 +74,7 @@ impl<'tcx> fmt::Display for FrameInfo<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
|
||||
impl<'gcx, 'tcx> ConstEvalErr<'tcx> {
|
||||
pub fn struct_error(&self,
|
||||
tcx: TyCtxtAt<'gcx, 'tcx>,
|
||||
message: &str)
|
||||
@ -172,7 +172,7 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn struct_error<'a, 'gcx, 'tcx>(
|
||||
pub fn struct_error<'gcx, 'tcx>(
|
||||
tcx: TyCtxtAt<'gcx, 'tcx>,
|
||||
msg: &str,
|
||||
) -> DiagnosticBuilder<'tcx> {
|
||||
|
@ -64,10 +64,7 @@ enum AllocDiscriminant {
|
||||
Static,
|
||||
}
|
||||
|
||||
pub fn specialized_encode_alloc_id<
|
||||
'a, 'tcx,
|
||||
E: Encoder,
|
||||
>(
|
||||
pub fn specialized_encode_alloc_id<'tcx, E: Encoder>(
|
||||
encoder: &mut E,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
alloc_id: AllocId,
|
||||
@ -147,7 +144,7 @@ pub struct AllocDecodingSession<'s> {
|
||||
impl<'s> AllocDecodingSession<'s> {
|
||||
|
||||
// Decodes an AllocId in a thread-safe way.
|
||||
pub fn decode_alloc_id<'a, 'tcx, D>(&self,
|
||||
pub fn decode_alloc_id<'tcx, D>(&self,
|
||||
decoder: &mut D)
|
||||
-> Result<AllocId, D::Error>
|
||||
where D: TyDecoder<'tcx>,
|
||||
|
@ -1240,7 +1240,7 @@ impl<'tcx> Terminator<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> TerminatorKind<'tcx> {
|
||||
pub fn if_<'a, 'gcx>(
|
||||
pub fn if_<'gcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
cond: Operand<'tcx>,
|
||||
t: BasicBlock,
|
||||
@ -2323,7 +2323,7 @@ impl<'tcx> Operand<'tcx> {
|
||||
/// Convenience helper to make a constant that refers to the fn
|
||||
/// with given `DefId` and substs. Since this is used to synthesize
|
||||
/// MIR, assumes `user_ty` is None.
|
||||
pub fn function_handle<'a>(
|
||||
pub fn function_handle(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
def_id: DefId,
|
||||
substs: SubstsRef<'tcx>,
|
||||
|
@ -48,7 +48,7 @@ pub enum MonoItem<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> MonoItem<'tcx> {
|
||||
pub fn size_estimate<'a>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> usize {
|
||||
pub fn size_estimate(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> usize {
|
||||
match *self {
|
||||
MonoItem::Fn(instance) => {
|
||||
// Estimate the size of a function based on how many statements
|
||||
@ -195,7 +195,7 @@ impl<'tcx> MonoItem<'tcx> {
|
||||
}
|
||||
};
|
||||
|
||||
fn to_string_internal<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn to_string_internal<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
prefix: &str,
|
||||
instance: Instance<'tcx>,
|
||||
debug: bool)
|
||||
@ -334,7 +334,7 @@ impl<'tcx> CodegenUnit<'tcx> {
|
||||
base_n::encode(hash, base_n::CASE_INSENSITIVE)
|
||||
}
|
||||
|
||||
pub fn estimate_size<'a>(&mut self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn estimate_size(&mut self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
// Estimate the size of a codegen unit as (approximately) the number of MIR
|
||||
// statements it corresponds to.
|
||||
self.size_estimate = Some(self.items.keys().map(|mi| mi.size_estimate(tcx)).sum());
|
||||
@ -369,7 +369,7 @@ impl<'tcx> CodegenUnit<'tcx> {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn items_in_deterministic_order<'a>(&self,
|
||||
pub fn items_in_deterministic_order(&self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>)
|
||||
-> Vec<(MonoItem<'tcx>,
|
||||
(Linkage, Visibility))> {
|
||||
@ -378,7 +378,7 @@ impl<'tcx> CodegenUnit<'tcx> {
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct ItemSortKey(Option<HirId>, SymbolName);
|
||||
|
||||
fn item_sort_key<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn item_sort_key<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
item: MonoItem<'tcx>) -> ItemSortKey {
|
||||
ItemSortKey(match item {
|
||||
MonoItem::Fn(ref instance) => {
|
||||
|
@ -21,7 +21,7 @@ pub struct PlaceTy<'tcx> {
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
static_assert_size!(PlaceTy<'_>, 16);
|
||||
|
||||
impl<'a, 'gcx, 'tcx> PlaceTy<'tcx> {
|
||||
impl<'gcx, 'tcx> PlaceTy<'tcx> {
|
||||
pub fn from_ty(ty: Ty<'tcx>) -> PlaceTy<'tcx> {
|
||||
PlaceTy { ty, variant_index: None }
|
||||
}
|
||||
@ -121,7 +121,7 @@ BraceStructTypeFoldableImpl! {
|
||||
}
|
||||
|
||||
impl<'tcx> Place<'tcx> {
|
||||
pub fn ty<'a, 'gcx, D>(&self, local_decls: &D, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> PlaceTy<'tcx>
|
||||
pub fn ty<'gcx, D>(&self, local_decls: &D, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> PlaceTy<'tcx>
|
||||
where D: HasLocalDecls<'tcx>
|
||||
{
|
||||
match *self {
|
||||
@ -141,7 +141,7 @@ pub enum RvalueInitializationState {
|
||||
}
|
||||
|
||||
impl<'tcx> Rvalue<'tcx> {
|
||||
pub fn ty<'a, 'gcx, D>(&self, local_decls: &D, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx>
|
||||
pub fn ty<'gcx, D>(&self, local_decls: &D, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx>
|
||||
where D: HasLocalDecls<'tcx>
|
||||
{
|
||||
match *self {
|
||||
@ -222,7 +222,7 @@ impl<'tcx> Rvalue<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> Operand<'tcx> {
|
||||
pub fn ty<'a, 'gcx, D>(&self, local_decls: &D, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx>
|
||||
pub fn ty<'gcx, D>(&self, local_decls: &D, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx>
|
||||
where D: HasLocalDecls<'tcx>
|
||||
{
|
||||
match self {
|
||||
@ -234,7 +234,7 @@ impl<'tcx> Operand<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> BinOp {
|
||||
pub fn ty<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
pub fn ty<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
lhs_ty: Ty<'tcx>,
|
||||
rhs_ty: Ty<'tcx>)
|
||||
-> Ty<'tcx> {
|
||||
|
@ -18,7 +18,7 @@ use crate::ty::fold::TypeFoldable;
|
||||
/// that type check should guarantee to us that all nested
|
||||
/// obligations *could be* resolved if we wanted to.
|
||||
/// Assumes that this is run after the entire crate has been successfully type-checked.
|
||||
pub fn codegen_fulfill_obligation<'a, 'tcx>(ty: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
pub fn codegen_fulfill_obligation<'tcx>(ty: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
(param_env, trait_ref):
|
||||
(ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>))
|
||||
-> Vtable<'tcx, ()>
|
||||
@ -74,7 +74,7 @@ pub fn codegen_fulfill_obligation<'a, 'tcx>(ty: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
})
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
impl<'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
/// Monomorphizes a type from the AST by first applying the
|
||||
/// in-scope substitutions and then normalizing any associated
|
||||
/// types.
|
||||
|
@ -183,7 +183,7 @@ fn overlap_within_probe(
|
||||
Some(OverlapResult { impl_header, intercrate_ambiguity_causes, involves_placeholder })
|
||||
}
|
||||
|
||||
pub fn trait_ref_is_knowable<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
pub fn trait_ref_is_knowable<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
trait_ref: ty::TraitRef<'tcx>)
|
||||
-> Option<Conflict>
|
||||
{
|
||||
@ -229,7 +229,7 @@ pub fn trait_ref_is_knowable<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn trait_ref_is_local_or_fundamental<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
pub fn trait_ref_is_local_or_fundamental<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
trait_ref: ty::TraitRef<'tcx>)
|
||||
-> bool {
|
||||
trait_ref.def_id.krate == LOCAL_CRATE || tcx.has_attr(trait_ref.def_id, sym::fundamental)
|
||||
@ -246,7 +246,7 @@ pub enum OrphanCheckErr<'tcx> {
|
||||
///
|
||||
/// 1. All type parameters in `Self` must be "covered" by some local type constructor.
|
||||
/// 2. Some local type must appear in `Self`.
|
||||
pub fn orphan_check<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
pub fn orphan_check<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
impl_def_id: DefId)
|
||||
-> Result<(), OrphanCheckErr<'tcx>>
|
||||
{
|
||||
|
@ -1249,7 +1249,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
||||
found: ty::PolyTraitRef<'tcx>)
|
||||
-> DiagnosticBuilder<'tcx>
|
||||
{
|
||||
fn build_fn_sig_string<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
fn build_fn_sig_string<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
trait_ref: &ty::TraitRef<'tcx>) -> String {
|
||||
let inputs = trait_ref.substs.type_at(1);
|
||||
let sig = if let ty::Tuple(inputs) = inputs.sty {
|
||||
@ -1294,7 +1294,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
pub fn recursive_type_with_infinite_size_error(self,
|
||||
type_def_id: DefId)
|
||||
-> DiagnosticBuilder<'tcx>
|
||||
|
@ -140,7 +140,7 @@ pub struct ObligationCause<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> ObligationCause<'tcx> {
|
||||
pub fn span<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Span {
|
||||
pub fn span<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Span {
|
||||
match self.code {
|
||||
ObligationCauseCode::CompareImplMethodObligation { .. } |
|
||||
ObligationCauseCode::MainFunctionType |
|
||||
@ -363,7 +363,7 @@ impl<'tcx> DomainGoal<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> GoalKind<'tcx> {
|
||||
pub fn from_poly_domain_goal<'a, 'gcx>(
|
||||
pub fn from_poly_domain_goal<'gcx>(
|
||||
domain_goal: PolyDomainGoal<'tcx>,
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
) -> GoalKind<'tcx> {
|
||||
@ -710,7 +710,7 @@ pub fn type_known_to_meet_bound_modulo_regions<'a, 'gcx, 'tcx>(
|
||||
}
|
||||
}
|
||||
|
||||
fn do_normalize_predicates<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn do_normalize_predicates<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
region_context: DefId,
|
||||
cause: ObligationCause<'tcx>,
|
||||
elaborated_env: ty::ParamEnv<'tcx>,
|
||||
@ -795,7 +795,7 @@ fn do_normalize_predicates<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
|
||||
// FIXME: this is gonna need to be removed ...
|
||||
/// Normalizes the parameter environment, reporting errors if they occur.
|
||||
pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
pub fn normalize_param_env_or_error<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
region_context: DefId,
|
||||
unnormalized_env: ty::ParamEnv<'tcx>,
|
||||
cause: ObligationCause<'tcx>)
|
||||
@ -936,7 +936,7 @@ pub fn fully_normalize<'a, 'gcx, 'tcx, T>(
|
||||
/// environment. If this returns false, then either normalize
|
||||
/// encountered an error or one of the predicates did not hold. Used
|
||||
/// when creating vtables to check for unsatisfiable methods.
|
||||
fn normalize_and_test_predicates<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn normalize_and_test_predicates<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
predicates: Vec<ty::Predicate<'tcx>>)
|
||||
-> bool
|
||||
{
|
||||
@ -965,7 +965,7 @@ fn normalize_and_test_predicates<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
result
|
||||
}
|
||||
|
||||
fn substitute_normalize_and_test_predicates<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn substitute_normalize_and_test_predicates<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
key: (DefId, SubstsRef<'tcx>))
|
||||
-> bool
|
||||
{
|
||||
@ -983,7 +983,7 @@ fn substitute_normalize_and_test_predicates<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 't
|
||||
/// Given a trait `trait_ref`, iterates the vtable entries
|
||||
/// that come from `trait_ref`, including its supertraits.
|
||||
#[inline] // FIXME(#35870): avoid closures being unexported due to `impl Trait`.
|
||||
fn vtable_methods<'a, 'tcx>(
|
||||
fn vtable_methods<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
trait_ref: ty::PolyTraitRef<'tcx>)
|
||||
-> &'tcx [Option<(DefId, SubstsRef<'tcx>)>]
|
||||
@ -1205,17 +1205,17 @@ where
|
||||
type LiftedDelayedLiteral: Debug + 'tcx;
|
||||
type LiftedLiteral: Debug + 'tcx;
|
||||
|
||||
fn lift_ex_clause_to_tcx<'a, 'gcx>(
|
||||
fn lift_ex_clause_to_tcx<'gcx>(
|
||||
ex_clause: &chalk_engine::ExClause<Self>,
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
) -> Option<Self::LiftedExClause>;
|
||||
|
||||
fn lift_delayed_literal_to_tcx<'a, 'gcx>(
|
||||
fn lift_delayed_literal_to_tcx<'gcx>(
|
||||
ex_clause: &chalk_engine::DelayedLiteral<Self>,
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
) -> Option<Self::LiftedDelayedLiteral>;
|
||||
|
||||
fn lift_literal_to_tcx<'a, 'gcx>(
|
||||
fn lift_literal_to_tcx<'gcx>(
|
||||
ex_clause: &chalk_engine::Literal<Self>,
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
) -> Option<Self::LiftedLiteral>;
|
||||
|
@ -83,7 +83,7 @@ pub enum MethodViolationCode {
|
||||
UndispatchableReceiver,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
impl<'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
|
||||
/// Returns the object safety violations that affect
|
||||
/// astconv -- currently, `Self` in supertraits. This is needed
|
||||
@ -703,7 +703,7 @@ impl<'a, 'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn is_object_safe_provider<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
pub(super) fn is_object_safe_provider<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
trait_def_id: DefId) -> bool {
|
||||
tcx.object_safety_violations(trait_def_id).is_empty()
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ fn parse_error(tcx: TyCtxt<'_, '_, '_>, span: Span,
|
||||
ErrorReported
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> OnUnimplementedDirective {
|
||||
impl<'gcx, 'tcx> OnUnimplementedDirective {
|
||||
fn parse(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
trait_def_id: DefId,
|
||||
items: &[NestedMetaItem],
|
||||
@ -214,7 +214,7 @@ impl<'a, 'gcx, 'tcx> OnUnimplementedDirective {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> OnUnimplementedFormatString {
|
||||
impl<'gcx, 'tcx> OnUnimplementedFormatString {
|
||||
fn try_parse(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
trait_def_id: DefId,
|
||||
from: LocalInternedString,
|
||||
|
@ -836,7 +836,7 @@ struct Progress<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> Progress<'tcx> {
|
||||
fn error<'a,'gcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Self {
|
||||
fn error<'gcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Self {
|
||||
Progress {
|
||||
ty: tcx.types.err,
|
||||
obligations: vec![],
|
||||
|
@ -10,7 +10,7 @@
|
||||
use crate::ty::{self, Ty, TyCtxt};
|
||||
use crate::ty::fold::{TypeFoldable, TypeFolder};
|
||||
|
||||
impl<'cx, 'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
impl<'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
/// Erase the regions in `value` and then fully normalize all the
|
||||
/// types found within. The result will also have regions erased.
|
||||
///
|
||||
|
@ -300,7 +300,7 @@ enum SelectionCandidate<'tcx> {
|
||||
|
||||
impl<'a, 'tcx> ty::Lift<'tcx> for SelectionCandidate<'a> {
|
||||
type Lifted = SelectionCandidate<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
Some(match *self {
|
||||
BuiltinCandidate { has_nested } => BuiltinCandidate { has_nested },
|
||||
ImplCandidate(def_id) => ImplCandidate(def_id),
|
||||
|
@ -109,7 +109,7 @@ pub fn translate_substs<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
|
||||
/// the kind `kind`, and trait method substitutions `substs`, in
|
||||
/// that impl, a less specialized impl, or the trait default,
|
||||
/// whichever applies.
|
||||
pub fn find_associated_item<'a, 'tcx>(
|
||||
pub fn find_associated_item<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
item: &ty::AssocItem,
|
||||
@ -149,7 +149,7 @@ pub fn find_associated_item<'a, 'tcx>(
|
||||
/// Specialization is determined by the sets of types to which the impls apply;
|
||||
/// `impl1` specializes `impl2` if it applies to a subset of the types `impl2` applies
|
||||
/// to.
|
||||
pub(super) fn specializes<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
pub(super) fn specializes<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
(impl1_def_id, impl2_def_id): (DefId, DefId))
|
||||
-> bool
|
||||
{
|
||||
@ -285,7 +285,7 @@ fn fulfill_implication<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
|
||||
}
|
||||
|
||||
// Query provider for `specialization_graph_of`.
|
||||
pub(super) fn specialization_graph_provider<'a, 'tcx>(
|
||||
pub(super) fn specialization_graph_provider<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
trait_id: DefId,
|
||||
) -> &'tcx specialization_graph::Graph {
|
||||
|
@ -81,7 +81,7 @@ enum Inserted {
|
||||
ShouldRecurseOn(DefId),
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> Children {
|
||||
impl<'gcx, 'tcx> Children {
|
||||
/// Insert an impl into this set of children without comparing to any existing impls.
|
||||
fn insert_blindly(&mut self,
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
@ -282,7 +282,7 @@ impl<I, J> Iterator for PotentialSiblings<I, J>
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> Graph {
|
||||
impl<'gcx, 'tcx> Graph {
|
||||
pub fn new() -> Graph {
|
||||
Graph {
|
||||
parent: Default::default(),
|
||||
@ -414,7 +414,7 @@ pub enum Node {
|
||||
Trait(DefId),
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> Node {
|
||||
impl<'gcx, 'tcx> Node {
|
||||
pub fn is_from_trait(&self) -> bool {
|
||||
match *self {
|
||||
Node::Trait(..) => true,
|
||||
|
@ -446,7 +446,7 @@ impl<'tcx> fmt::Display for traits::Clause<'tcx> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for traits::SelectionError<'a> {
|
||||
type Lifted = traits::SelectionError<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match *self {
|
||||
super::Unimplemented => Some(super::Unimplemented),
|
||||
super::OutputTypeParameterMismatch(a, b, ref err) => {
|
||||
@ -464,7 +464,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::SelectionError<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCauseCode<'a> {
|
||||
type Lifted = traits::ObligationCauseCode<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match *self {
|
||||
super::ReturnNoExpression => Some(super::ReturnNoExpression),
|
||||
super::MiscObligation => Some(super::MiscObligation),
|
||||
@ -546,7 +546,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCauseCode<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for traits::DerivedObligationCause<'a> {
|
||||
type Lifted = traits::DerivedObligationCause<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.parent_trait_ref).and_then(|trait_ref|
|
||||
tcx.lift(&*self.parent_code)
|
||||
.map(|code| traits::DerivedObligationCause {
|
||||
@ -559,7 +559,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::DerivedObligationCause<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCause<'a> {
|
||||
type Lifted = traits::ObligationCause<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.code).map(|code| traits::ObligationCause {
|
||||
span: self.span,
|
||||
body_id: self.body_id,
|
||||
@ -571,7 +571,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCause<'a> {
|
||||
// For codegen only.
|
||||
impl<'a, 'tcx> Lift<'tcx> for traits::Vtable<'a, ()> {
|
||||
type Lifted = traits::Vtable<'tcx, ()>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match self.clone() {
|
||||
traits::VtableImpl(traits::VtableImplData {
|
||||
impl_def_id,
|
||||
@ -691,7 +691,7 @@ EnumLiftImpl! {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for traits::Environment<'a> {
|
||||
type Lifted = traits::Environment<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.clauses).map(|clauses| {
|
||||
traits::Environment {
|
||||
clauses,
|
||||
@ -702,7 +702,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::Environment<'a> {
|
||||
|
||||
impl<'a, 'tcx, G: Lift<'tcx>> Lift<'tcx> for traits::InEnvironment<'a, G> {
|
||||
type Lifted = traits::InEnvironment<'tcx, G::Lifted>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.environment).and_then(|environment| {
|
||||
tcx.lift(&self.goal).map(|goal| {
|
||||
traits::InEnvironment {
|
||||
@ -721,7 +721,7 @@ where
|
||||
{
|
||||
type Lifted = C::LiftedExClause;
|
||||
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
<C as traits::ChalkContextLift>::lift_ex_clause_to_tcx(self, tcx)
|
||||
}
|
||||
}
|
||||
@ -733,7 +733,7 @@ where
|
||||
{
|
||||
type Lifted = C::LiftedDelayedLiteral;
|
||||
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
<C as traits::ChalkContextLift>::lift_delayed_literal_to_tcx(self, tcx)
|
||||
}
|
||||
}
|
||||
@ -745,7 +745,7 @@ where
|
||||
{
|
||||
type Lifted = C::LiftedLiteral;
|
||||
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
<C as traits::ChalkContextLift>::lift_literal_to_tcx(self, tcx)
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ use crate::util::nodemap::FxHashSet;
|
||||
|
||||
use super::{Obligation, ObligationCause, PredicateObligation, SelectionContext, Normalized};
|
||||
|
||||
fn anonymize_predicate<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
fn anonymize_predicate<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
pred: &ty::Predicate<'tcx>)
|
||||
-> ty::Predicate<'tcx> {
|
||||
match *pred {
|
||||
@ -93,7 +93,7 @@ pub struct Elaborator<'gcx, 'tcx> {
|
||||
visited: PredicateSet<'gcx, 'tcx>,
|
||||
}
|
||||
|
||||
pub fn elaborate_trait_ref<'cx, 'gcx, 'tcx>(
|
||||
pub fn elaborate_trait_ref<'gcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
trait_ref: ty::PolyTraitRef<'tcx>)
|
||||
-> Elaborator<'gcx, 'tcx>
|
||||
@ -101,7 +101,7 @@ pub fn elaborate_trait_ref<'cx, 'gcx, 'tcx>(
|
||||
elaborate_predicates(tcx, vec![trait_ref.to_predicate()])
|
||||
}
|
||||
|
||||
pub fn elaborate_trait_refs<'cx, 'gcx, 'tcx>(
|
||||
pub fn elaborate_trait_refs<'gcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
trait_refs: impl Iterator<Item = ty::PolyTraitRef<'tcx>>)
|
||||
-> Elaborator<'gcx, 'tcx>
|
||||
@ -110,7 +110,7 @@ pub fn elaborate_trait_refs<'cx, 'gcx, 'tcx>(
|
||||
elaborate_predicates(tcx, predicates)
|
||||
}
|
||||
|
||||
pub fn elaborate_predicates<'cx, 'gcx, 'tcx>(
|
||||
pub fn elaborate_predicates<'gcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
mut predicates: Vec<ty::Predicate<'tcx>>)
|
||||
-> Elaborator<'gcx, 'tcx>
|
||||
@ -256,13 +256,13 @@ impl Iterator for Elaborator<'gcx, 'tcx> {
|
||||
|
||||
pub type Supertraits<'gcx, 'tcx> = FilterToTraits<Elaborator<'gcx, 'tcx>>;
|
||||
|
||||
pub fn supertraits<'cx, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
pub fn supertraits<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
trait_ref: ty::PolyTraitRef<'tcx>)
|
||||
-> Supertraits<'gcx, 'tcx> {
|
||||
elaborate_trait_ref(tcx, trait_ref).filter_to_traits()
|
||||
}
|
||||
|
||||
pub fn transitive_bounds<'cx, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
pub fn transitive_bounds<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
bounds: impl Iterator<Item = ty::PolyTraitRef<'tcx>>)
|
||||
-> Supertraits<'gcx, 'tcx> {
|
||||
elaborate_trait_refs(tcx, bounds).filter_to_traits()
|
||||
@ -337,7 +337,7 @@ impl<'tcx> TraitAliasExpansionInfo<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn expand_trait_aliases<'cx, 'gcx, 'tcx>(
|
||||
pub fn expand_trait_aliases<'gcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
trait_refs: impl IntoIterator<Item = (ty::PolyTraitRef<'tcx>, Span)>
|
||||
) -> TraitAliasExpander<'gcx, 'tcx> {
|
||||
@ -348,7 +348,7 @@ pub fn expand_trait_aliases<'cx, 'gcx, 'tcx>(
|
||||
TraitAliasExpander { tcx, stack: items }
|
||||
}
|
||||
|
||||
impl<'cx, 'gcx, 'tcx> TraitAliasExpander<'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TraitAliasExpander<'gcx, 'tcx> {
|
||||
/// If `item` is a trait alias and its predicate has not yet been visited, then expands `item`
|
||||
/// to the definition, pushes the resulting expansion onto `self.stack`, and returns `false`.
|
||||
/// Otherwise, immediately returns `true` if `item` is a regular trait, or `false` if it is a
|
||||
@ -393,7 +393,7 @@ impl<'cx, 'gcx, 'tcx> TraitAliasExpander<'gcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'cx, 'gcx, 'tcx> Iterator for TraitAliasExpander<'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> Iterator for TraitAliasExpander<'gcx, 'tcx> {
|
||||
type Item = TraitAliasExpansionInfo<'tcx>;
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
@ -420,7 +420,7 @@ pub struct SupertraitDefIds<'gcx, 'tcx> {
|
||||
visited: FxHashSet<DefId>,
|
||||
}
|
||||
|
||||
pub fn supertrait_def_ids<'cx, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
pub fn supertrait_def_ids<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
trait_def_id: DefId)
|
||||
-> SupertraitDefIds<'gcx, 'tcx>
|
||||
{
|
||||
@ -552,7 +552,7 @@ pub fn predicate_for_trait_ref<'tcx>(
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
pub fn predicate_for_trait_def(self,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
cause: ObligationCause<'tcx>,
|
||||
|
@ -103,7 +103,7 @@ pub struct OverloadedDeref<'tcx> {
|
||||
pub mutbl: hir::Mutability,
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> OverloadedDeref<'tcx> {
|
||||
impl<'gcx, 'tcx> OverloadedDeref<'tcx> {
|
||||
pub fn method_call(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>, source: Ty<'tcx>)
|
||||
-> (DefId, SubstsRef<'tcx>) {
|
||||
let trait_def_id = match self.mutbl {
|
||||
|
@ -6,7 +6,7 @@ use syntax_pos::symbol::{sym, Symbol};
|
||||
use crate::hir::map::blocks::FnLikeNode;
|
||||
use syntax::attr;
|
||||
|
||||
impl<'a, 'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
impl<'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
/// Whether the `def_id` counts as const fn in your current crate, considering all active
|
||||
/// feature gates
|
||||
pub fn is_const_fn(self, def_id: DefId) -> bool {
|
||||
@ -69,7 +69,7 @@ impl<'a, 'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
|
||||
pub fn provide<'tcx>(providers: &mut Providers<'tcx>) {
|
||||
/// only checks whether the function has a `const` modifier
|
||||
fn is_const_fn_raw<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> bool {
|
||||
fn is_const_fn_raw<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> bool {
|
||||
let hir_id = tcx.hir().as_local_hir_id(def_id)
|
||||
.expect("Non-local call to local provider is_const_fn");
|
||||
|
||||
@ -83,7 +83,7 @@ pub fn provide<'tcx>(providers: &mut Providers<'tcx>) {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_promotable_const_fn<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> bool {
|
||||
fn is_promotable_const_fn<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> bool {
|
||||
tcx.is_const_fn(def_id) && match tcx.lookup_stability(def_id) {
|
||||
Some(stab) => {
|
||||
if cfg!(debug_assertions) && stab.promotable {
|
||||
@ -101,7 +101,7 @@ pub fn provide<'tcx>(providers: &mut Providers<'tcx>) {
|
||||
}
|
||||
}
|
||||
|
||||
fn const_fn_is_allowed_fn_ptr<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> bool {
|
||||
fn const_fn_is_allowed_fn_ptr<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> bool {
|
||||
tcx.is_const_fn(def_id) &&
|
||||
tcx.lookup_stability(def_id)
|
||||
.map(|stab| stab.allow_const_fn_ptr).unwrap_or(false)
|
||||
|
@ -1666,7 +1666,7 @@ impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
impl<'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
pub fn encode_metadata(self)
|
||||
-> EncodedMetadata
|
||||
{
|
||||
@ -1725,7 +1725,7 @@ impl<'gcx> GlobalCtxt<'gcx> {
|
||||
/// e.g., `()` or `u8`, was interned in a different context.
|
||||
pub trait Lift<'tcx>: fmt::Debug {
|
||||
type Lifted: fmt::Debug + 'tcx;
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted>;
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted>;
|
||||
}
|
||||
|
||||
|
||||
@ -1733,7 +1733,7 @@ macro_rules! nop_lift {
|
||||
($ty:ty => $lifted:ty) => {
|
||||
impl<'a, 'tcx> Lift<'tcx> for $ty {
|
||||
type Lifted = $lifted;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
if tcx.interners.arena.in_arena(*self as *const _) {
|
||||
return Some(unsafe { mem::transmute(*self) });
|
||||
}
|
||||
@ -1752,7 +1752,7 @@ macro_rules! nop_list_lift {
|
||||
($ty:ty => $lifted:ty) => {
|
||||
impl<'a, 'tcx> Lift<'tcx> for &'a List<$ty> {
|
||||
type Lifted = &'tcx List<$lifted>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
if self.is_empty() {
|
||||
return Some(List::empty());
|
||||
}
|
||||
@ -1978,7 +1978,7 @@ pub mod tls {
|
||||
/// Creates a TyCtxt and ImplicitCtxt based on the GCX_PTR thread local.
|
||||
/// This is used in the deadlock handler.
|
||||
pub unsafe fn with_global<F, R>(f: F) -> R
|
||||
where F: for<'a, 'gcx, 'tcx> FnOnce(TyCtxt<'tcx, 'gcx, 'tcx>) -> R
|
||||
where F: for<'gcx, 'tcx> FnOnce(TyCtxt<'tcx, 'gcx, 'tcx>) -> R
|
||||
{
|
||||
let gcx = GCX_PTR.with(|lock| *lock.lock());
|
||||
assert!(gcx != 0);
|
||||
@ -2065,7 +2065,7 @@ pub mod tls {
|
||||
/// Panics if there is no ImplicitCtxt available
|
||||
#[inline]
|
||||
pub fn with<F, R>(f: F) -> R
|
||||
where F: for<'a, 'gcx, 'tcx> FnOnce(TyCtxt<'tcx, 'gcx, 'tcx>) -> R
|
||||
where F: for<'gcx, 'tcx> FnOnce(TyCtxt<'tcx, 'gcx, 'tcx>) -> R
|
||||
{
|
||||
with_context(|context| f(context.tcx))
|
||||
}
|
||||
@ -2074,7 +2074,7 @@ pub mod tls {
|
||||
/// The closure is passed None if there is no ImplicitCtxt available
|
||||
#[inline]
|
||||
pub fn with_opt<F, R>(f: F) -> R
|
||||
where F: for<'a, 'gcx, 'tcx> FnOnce(Option<TyCtxt<'tcx, 'gcx, 'tcx>>) -> R
|
||||
where F: for<'gcx, 'tcx> FnOnce(Option<TyCtxt<'tcx, 'gcx, 'tcx>>) -> R
|
||||
{
|
||||
with_context_opt(|opt_context| f(opt_context.map(|context| context.tcx)))
|
||||
}
|
||||
@ -2151,7 +2151,7 @@ macro_rules! sty_debug_print {
|
||||
}}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
impl<'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
pub fn print_debug_stats(self) {
|
||||
sty_debug_print!(
|
||||
self,
|
||||
@ -2400,7 +2400,7 @@ intern_method! {
|
||||
) -> List<CanonicalVarInfo>
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
/// Given a `fn` type, returns an equivalent `unsafe fn` type;
|
||||
/// that is, a `fn` type that is equivalent in every way for being
|
||||
/// unsafe.
|
||||
|
@ -8,13 +8,13 @@ pub(super) fn provide(providers: &mut ty::query::Providers<'_>) {
|
||||
};
|
||||
}
|
||||
|
||||
fn erase_regions_ty<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
|
||||
fn erase_regions_ty<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> {
|
||||
// N.B., use `super_fold_with` here. If we used `fold_with`, it
|
||||
// could invoke the `erase_regions_ty` query recursively.
|
||||
ty.super_fold_with(&mut RegionEraserVisitor { tcx })
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
/// Returns an equivalent value with all free regions removed (note
|
||||
/// that late-bound regions remain, because they are important for
|
||||
/// subtyping, but they are anonymized and normalized as well)..
|
||||
|
@ -183,7 +183,7 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'lcx, 'tcx> ty::TyS<'tcx> {
|
||||
impl<'gcx, 'lcx, 'tcx> ty::TyS<'tcx> {
|
||||
pub fn sort_string(&self, tcx: TyCtxt<'lcx, 'gcx, 'lcx>) -> Cow<'static, str> {
|
||||
match self.sty {
|
||||
ty::Bool | ty::Char | ty::Int(_) |
|
||||
@ -249,7 +249,7 @@ impl<'a, 'gcx, 'lcx, 'tcx> ty::TyS<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
pub fn note_and_explain_type_err(self,
|
||||
db: &mut DiagnosticBuilder<'_>,
|
||||
err: &TypeError<'tcx>,
|
||||
|
@ -55,7 +55,7 @@ pub enum SimplifiedTypeGen<D>
|
||||
/// then we can't say much about whether two types would unify. Put another way,
|
||||
/// `can_simplify_params` should be true if type parameters appear free in `ty` and `false` if they
|
||||
/// are to be considered bound.
|
||||
pub fn simplify_type<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
pub fn simplify_type<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
ty: Ty<'_>,
|
||||
can_simplify_params: bool)
|
||||
-> Option<SimplifiedType>
|
||||
|
@ -235,7 +235,7 @@ impl<'gcx, 'tcx, F, G, H> TypeFolder<'gcx, 'tcx> for BottomUpFolder<'gcx, 'tcx,
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Region folder
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
/// Collects the free and escaping regions in `value` into `region_set`. Returns
|
||||
/// whether any late-bound regions were skipped
|
||||
pub fn collect_regions<T>(self,
|
||||
@ -542,7 +542,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for BoundVarReplacer<'a, 'gcx, 'tcx>
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
/// Replaces all regions bound by the given `Binder` with the
|
||||
/// results returned by the closure; the closure is expected to
|
||||
/// return a free region (relative to this binder), and hence the
|
||||
@ -817,7 +817,7 @@ impl TypeFolder<'gcx, 'tcx> for Shifter<'gcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn shift_region<'a, 'gcx, 'tcx>(
|
||||
pub fn shift_region<'gcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
region: ty::Region<'tcx>,
|
||||
amount: u32
|
||||
@ -832,7 +832,7 @@ pub fn shift_region<'a, 'gcx, 'tcx>(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn shift_vars<'a, 'gcx, 'tcx, T>(
|
||||
pub fn shift_vars<'gcx, 'tcx, T>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
value: &T,
|
||||
amount: u32
|
||||
@ -843,7 +843,7 @@ pub fn shift_vars<'a, 'gcx, 'tcx, T>(
|
||||
value.fold_with(&mut Shifter::new(tcx, amount, Direction::In))
|
||||
}
|
||||
|
||||
pub fn shift_out_vars<'a, 'gcx, 'tcx, T>(
|
||||
pub fn shift_out_vars<'gcx, 'tcx, T>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
value: &T,
|
||||
amount: u32
|
||||
|
@ -21,7 +21,7 @@ pub struct DefIdForest {
|
||||
root_ids: SmallVec<[DefId; 1]>,
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> DefIdForest {
|
||||
impl<'gcx, 'tcx> DefIdForest {
|
||||
/// Creates an empty forest.
|
||||
pub fn empty() -> DefIdForest {
|
||||
DefIdForest {
|
||||
|
@ -51,7 +51,7 @@ mod def_id_forest;
|
||||
// This code should only compile in modules where the uninhabitedness of Foo is
|
||||
// visible.
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
/// Checks whether a type is visibly uninhabited from a particular module.
|
||||
/// # Example
|
||||
/// ```rust
|
||||
@ -106,7 +106,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> AdtDef {
|
||||
impl<'gcx, 'tcx> AdtDef {
|
||||
/// Calculate the forest of DefIds from which this adt is visibly uninhabited.
|
||||
fn uninhabited_from(
|
||||
&self,
|
||||
@ -124,7 +124,7 @@ impl<'a, 'gcx, 'tcx> AdtDef {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> VariantDef {
|
||||
impl<'gcx, 'tcx> VariantDef {
|
||||
/// Calculate the forest of DefIds from which this variant is visibly uninhabited.
|
||||
pub fn uninhabited_from(
|
||||
&self,
|
||||
@ -150,7 +150,7 @@ impl<'a, 'gcx, 'tcx> VariantDef {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> FieldDef {
|
||||
impl<'gcx, 'tcx> FieldDef {
|
||||
/// Calculate the forest of DefIds from which this field is visibly uninhabited.
|
||||
fn uninhabited_from(
|
||||
&self,
|
||||
@ -180,7 +180,7 @@ impl<'a, 'gcx, 'tcx> FieldDef {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyS<'tcx> {
|
||||
impl<'gcx, 'tcx> TyS<'tcx> {
|
||||
/// Calculate the forest of DefIds from which this type is visibly uninhabited.
|
||||
fn uninhabited_from(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> DefIdForest
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ pub enum InstanceDef<'tcx> {
|
||||
CloneShim(DefId, Ty<'tcx>),
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Instance<'tcx> {
|
||||
impl<'tcx> Instance<'tcx> {
|
||||
pub fn ty(&self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>)
|
||||
-> Ty<'tcx>
|
||||
@ -136,11 +136,11 @@ impl<'tcx> InstanceDef<'tcx> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn attrs<'a>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> ty::Attributes<'tcx> {
|
||||
pub fn attrs(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> ty::Attributes<'tcx> {
|
||||
tcx.get_attrs(self.def_id())
|
||||
}
|
||||
|
||||
pub fn is_inline<'a>(
|
||||
pub fn is_inline(
|
||||
&self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>
|
||||
) -> bool {
|
||||
@ -156,7 +156,7 @@ impl<'tcx> InstanceDef<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn requires_local<'a>(
|
||||
pub fn requires_local(
|
||||
&self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>
|
||||
) -> bool {
|
||||
@ -209,7 +209,7 @@ impl<'tcx> fmt::Display for Instance<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'b, 'tcx> Instance<'tcx> {
|
||||
impl<'b, 'tcx> Instance<'tcx> {
|
||||
pub fn new(def_id: DefId, substs: SubstsRef<'tcx>)
|
||||
-> Instance<'tcx> {
|
||||
assert!(!substs.has_escaping_bound_vars(),
|
||||
@ -376,7 +376,7 @@ impl<'a, 'b, 'tcx> Instance<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn resolve_associated_item<'a, 'tcx>(
|
||||
fn resolve_associated_item<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
trait_item: &ty::AssocItem,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
|
@ -31,9 +31,9 @@ use rustc_target::abi::call::{
|
||||
|
||||
|
||||
pub trait IntegerExt {
|
||||
fn to_ty<'a, 'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>, signed: bool) -> Ty<'tcx>;
|
||||
fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>, signed: bool) -> Ty<'tcx>;
|
||||
fn from_attr<C: HasDataLayout>(cx: &C, ity: attr::IntType) -> Integer;
|
||||
fn repr_discr<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn repr_discr<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
ty: Ty<'tcx>,
|
||||
repr: &ReprOptions,
|
||||
min: i128,
|
||||
@ -42,7 +42,7 @@ pub trait IntegerExt {
|
||||
}
|
||||
|
||||
impl IntegerExt for Integer {
|
||||
fn to_ty<'a, 'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>, signed: bool) -> Ty<'tcx> {
|
||||
fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>, signed: bool) -> Ty<'tcx> {
|
||||
match (*self, signed) {
|
||||
(I8, false) => tcx.types.u8,
|
||||
(I16, false) => tcx.types.u16,
|
||||
@ -77,7 +77,7 @@ impl IntegerExt for Integer {
|
||||
/// signed discriminant range and #[repr] attribute.
|
||||
/// N.B.: u128 values above i128::MAX will be treated as signed, but
|
||||
/// that shouldn't affect anything, other than maybe debuginfo.
|
||||
fn repr_discr<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn repr_discr<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
ty: Ty<'tcx>,
|
||||
repr: &ReprOptions,
|
||||
min: i128,
|
||||
@ -126,11 +126,11 @@ impl IntegerExt for Integer {
|
||||
}
|
||||
|
||||
pub trait PrimitiveExt {
|
||||
fn to_ty<'a, 'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Ty<'tcx>;
|
||||
fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Ty<'tcx>;
|
||||
}
|
||||
|
||||
impl PrimitiveExt for Primitive {
|
||||
fn to_ty<'a, 'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Ty<'tcx> {
|
||||
fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Ty<'tcx> {
|
||||
match *self {
|
||||
Int(i, signed) => i.to_ty(tcx, signed),
|
||||
Float(FloatTy::F32) => tcx.types.f32,
|
||||
@ -171,7 +171,7 @@ impl<'tcx> fmt::Display for LayoutError<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn layout_raw<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn layout_raw<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
|
||||
-> Result<&'tcx LayoutDetails, LayoutError<'tcx>>
|
||||
{
|
||||
@ -226,7 +226,7 @@ enum StructKind {
|
||||
Prefixed(Size, Align),
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'tcx, 'tcx, 'tcx>> {
|
||||
impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx, 'tcx, 'tcx>> {
|
||||
fn scalar_pair(&self, a: Scalar, b: Scalar) -> LayoutDetails {
|
||||
let dl = self.data_layout();
|
||||
let b_align = b.value.align(dl);
|
||||
@ -1221,7 +1221,7 @@ enum SavedLocalEligibility {
|
||||
// Also included in the layout are the upvars and the discriminant.
|
||||
// These are included as fields on the "outer" layout; they are not part
|
||||
// of any variant.
|
||||
impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'tcx, 'tcx, 'tcx>> {
|
||||
impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx, 'tcx, 'tcx>> {
|
||||
/// Compute the eligibility and assignment of each local.
|
||||
fn generator_saved_local_eligibility(&self, info: &GeneratorLayout<'tcx>)
|
||||
-> (BitSet<GeneratorSavedLocal>, IndexVec<GeneratorSavedLocal, SavedLocalEligibility>) {
|
||||
@ -1603,7 +1603,7 @@ pub enum SizeSkeleton<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> SizeSkeleton<'tcx> {
|
||||
impl<'tcx> SizeSkeleton<'tcx> {
|
||||
pub fn compute(ty: Ty<'tcx>,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>)
|
||||
@ -1734,13 +1734,13 @@ pub trait HasParamEnv<'tcx> {
|
||||
fn param_env(&self) -> ty::ParamEnv<'tcx>;
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> HasDataLayout for TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> HasDataLayout for TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
fn data_layout(&self) -> &TargetDataLayout {
|
||||
&self.data_layout
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> HasTyCtxt<'gcx> for TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> HasTyCtxt<'gcx> for TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
fn tcx<'b>(&'b self) -> TyCtxt<'gcx, 'gcx, 'gcx> {
|
||||
self.global_tcx()
|
||||
}
|
||||
@ -1796,7 +1796,7 @@ impl<T, E> MaybeResult<T> for Result<T, E> {
|
||||
|
||||
pub type TyLayout<'tcx> = ::rustc_target::abi::TyLayout<'tcx, Ty<'tcx>>;
|
||||
|
||||
impl<'a, 'tcx> LayoutOf for LayoutCx<'tcx, TyCtxt<'tcx, 'tcx, 'tcx>> {
|
||||
impl<'tcx> LayoutOf for LayoutCx<'tcx, TyCtxt<'tcx, 'tcx, 'tcx>> {
|
||||
type Ty = Ty<'tcx>;
|
||||
type TyLayout = Result<TyLayout<'tcx>, LayoutError<'tcx>>;
|
||||
|
||||
@ -2187,7 +2187,7 @@ struct Niche {
|
||||
}
|
||||
|
||||
impl Niche {
|
||||
fn reserve<'a, 'tcx>(
|
||||
fn reserve<'tcx>(
|
||||
&self,
|
||||
cx: &LayoutCx<'tcx, TyCtxt<'tcx, 'tcx, 'tcx>>,
|
||||
count: u128,
|
||||
@ -2205,7 +2205,7 @@ impl Niche {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'tcx, 'tcx, 'tcx>> {
|
||||
impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx, 'tcx, 'tcx>> {
|
||||
/// Find the offset of a niche leaf field, starting from
|
||||
/// the given type and recursing through aggregates.
|
||||
// FIXME(eddyb) traverse already optimized enums.
|
||||
|
@ -213,7 +213,7 @@ impl AssocItem {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn signature<'a, 'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> String {
|
||||
pub fn signature<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> String {
|
||||
match self.kind {
|
||||
ty::AssocKind::Method => {
|
||||
// We skip the binder here because the binder would deanonymize all
|
||||
@ -259,7 +259,7 @@ pub trait DefIdTree: Copy {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> DefIdTree for TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> DefIdTree for TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
fn parent(self, id: DefId) -> Option<DefId> {
|
||||
self.def_key(id).parent.map(|index| DefId { index: index, ..id })
|
||||
}
|
||||
@ -912,7 +912,7 @@ pub struct Generics {
|
||||
pub has_late_bound_regions: Option<Span>,
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> Generics {
|
||||
impl<'gcx, 'tcx> Generics {
|
||||
pub fn count(&self) -> usize {
|
||||
self.parent_count + self.params.len()
|
||||
}
|
||||
@ -1019,7 +1019,7 @@ pub struct GenericPredicates<'tcx> {
|
||||
impl<'tcx> serialize::UseSpecializedEncodable for GenericPredicates<'tcx> {}
|
||||
impl<'tcx> serialize::UseSpecializedDecodable for GenericPredicates<'tcx> {}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> {
|
||||
impl<'gcx, 'tcx> GenericPredicates<'tcx> {
|
||||
pub fn instantiate(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>, substs: SubstsRef<'tcx>)
|
||||
-> InstantiatedPredicates<'tcx> {
|
||||
let mut instantiated = InstantiatedPredicates::empty();
|
||||
@ -1128,7 +1128,7 @@ impl<'tcx> AsRef<Predicate<'tcx>> for Predicate<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> Predicate<'tcx> {
|
||||
impl<'gcx, 'tcx> Predicate<'tcx> {
|
||||
/// Performs a substitution suitable for going from a
|
||||
/// poly-trait-ref to supertraits that must hold if that
|
||||
/// poly-trait-ref holds. This is slightly different from a normal
|
||||
@ -1838,7 +1838,7 @@ pub struct VariantDef {
|
||||
pub recovered: bool,
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> VariantDef {
|
||||
impl<'gcx, 'tcx> VariantDef {
|
||||
/// Creates a new `VariantDef`.
|
||||
///
|
||||
/// `variant_did` is the `DefId` that identifies the enum variant (if this `VariantDef`
|
||||
@ -2563,7 +2563,7 @@ impl<'gcx, 'tcx> AdtDef {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> FieldDef {
|
||||
impl<'gcx, 'tcx> FieldDef {
|
||||
pub fn ty(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>, subst: SubstsRef<'tcx>) -> Ty<'tcx> {
|
||||
tcx.type_of(self.did).subst(tcx, subst)
|
||||
}
|
||||
@ -2586,7 +2586,7 @@ pub enum ClosureKind {
|
||||
FnOnce,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> ClosureKind {
|
||||
impl<'tcx> ClosureKind {
|
||||
// This is the initial value used when doing upvar inference.
|
||||
pub const LATTICE_BOTTOM: ClosureKind = ClosureKind::Fn;
|
||||
|
||||
@ -3131,7 +3131,7 @@ impl Iterator for AssocItemsIterator<'_, '_> {
|
||||
}
|
||||
}
|
||||
|
||||
fn associated_item<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> AssocItem {
|
||||
fn associated_item<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> AssocItem {
|
||||
let id = tcx.hir().as_local_hir_id(def_id).unwrap();
|
||||
let parent_id = tcx.hir().get_parent_item(id);
|
||||
let parent_def_id = tcx.hir().local_def_id_from_hir_id(parent_id);
|
||||
@ -3176,7 +3176,7 @@ pub struct AdtSizedConstraint<'tcx>(pub &'tcx [Ty<'tcx>]);
|
||||
/// such.
|
||||
/// - a Error, if a type contained itself. The representability
|
||||
/// check should catch this case.
|
||||
fn adt_sized_constraint<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn adt_sized_constraint<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
def_id: DefId)
|
||||
-> AdtSizedConstraint<'tcx> {
|
||||
let def = tcx.adt_def(def_id);
|
||||
@ -3192,7 +3192,7 @@ fn adt_sized_constraint<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
AdtSizedConstraint(result)
|
||||
}
|
||||
|
||||
fn associated_item_def_ids<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn associated_item_def_ids<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
def_id: DefId)
|
||||
-> &'tcx [DefId] {
|
||||
let id = tcx.hir().as_local_hir_id(def_id).unwrap();
|
||||
@ -3217,14 +3217,14 @@ fn associated_item_def_ids<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
}
|
||||
}
|
||||
|
||||
fn def_span<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> Span {
|
||||
fn def_span<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> Span {
|
||||
tcx.hir().span_if_local(def_id).unwrap()
|
||||
}
|
||||
|
||||
/// If the given `DefId` describes an item belonging to a trait,
|
||||
/// returns the `DefId` of the trait that the trait item belongs to;
|
||||
/// otherwise, returns `None`.
|
||||
fn trait_of_item<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> Option<DefId> {
|
||||
fn trait_of_item<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> Option<DefId> {
|
||||
tcx.opt_associated_item(def_id)
|
||||
.and_then(|associated_item| {
|
||||
match associated_item.container {
|
||||
@ -3247,7 +3247,7 @@ pub fn is_impl_trait_defn(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Option<DefI
|
||||
}
|
||||
|
||||
/// See `ParamEnv` struct definition for details.
|
||||
fn param_env<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn param_env<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
def_id: DefId)
|
||||
-> ParamEnv<'tcx>
|
||||
{
|
||||
@ -3285,26 +3285,26 @@ fn param_env<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
traits::normalize_param_env_or_error(tcx, def_id, unnormalized_env, cause)
|
||||
}
|
||||
|
||||
fn crate_disambiguator<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn crate_disambiguator<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
crate_num: CrateNum) -> CrateDisambiguator {
|
||||
assert_eq!(crate_num, LOCAL_CRATE);
|
||||
tcx.sess.local_crate_disambiguator()
|
||||
}
|
||||
|
||||
fn original_crate_name<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn original_crate_name<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
crate_num: CrateNum) -> Symbol {
|
||||
assert_eq!(crate_num, LOCAL_CRATE);
|
||||
tcx.crate_name.clone()
|
||||
}
|
||||
|
||||
fn crate_hash<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn crate_hash<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
crate_num: CrateNum)
|
||||
-> Svh {
|
||||
assert_eq!(crate_num, LOCAL_CRATE);
|
||||
tcx.hir().crate_hash
|
||||
}
|
||||
|
||||
fn instance_def_size_estimate<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn instance_def_size_estimate<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
instance_def: InstanceDef<'tcx>)
|
||||
-> usize {
|
||||
match instance_def {
|
||||
@ -3321,7 +3321,7 @@ fn instance_def_size_estimate<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
/// If `def_id` is an issue 33140 hack impl, returns its self type; otherwise, returns `None`.
|
||||
///
|
||||
/// See [`ImplOverlapKind::Issue33140`] for more details.
|
||||
fn issue33140_self_ty<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn issue33140_self_ty<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
def_id: DefId)
|
||||
-> Option<Ty<'tcx>>
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ pub enum Component<'tcx> {
|
||||
EscapingProjection(Vec<Component<'tcx>>),
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
/// Push onto `out` all the things that must outlive `'a` for the condition
|
||||
/// `ty0: 'a` to hold. Note that `ty0` must be a **fully resolved type**.
|
||||
pub fn push_outlives_components(&self, ty0: Ty<'tcx>,
|
||||
|
@ -87,7 +87,7 @@ macro_rules! impl_disk_cacheable_query(
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn try_load_from_disk<'a>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn try_load_from_disk(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
id: SerializedDepNodeIndex)
|
||||
-> Option<Self::Value> {
|
||||
tcx.queries.on_disk_cache.try_load_query_result(tcx, id)
|
||||
|
@ -156,7 +156,7 @@ impl<'sess> OnDiskCache<'sess> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn serialize<'a, 'tcx, E>(&self,
|
||||
pub fn serialize<'tcx, E>(&self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
encoder: &mut E)
|
||||
-> Result<(), E::Error>
|
||||
@ -326,7 +326,7 @@ impl<'sess> OnDiskCache<'sess> {
|
||||
}
|
||||
|
||||
/// Loads a diagnostic emitted during the previous compilation session.
|
||||
pub fn load_diagnostics<'a, 'tcx>(&self,
|
||||
pub fn load_diagnostics<'tcx>(&self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
dep_node_index: SerializedDepNodeIndex)
|
||||
-> Vec<Diagnostic> {
|
||||
|
@ -259,7 +259,7 @@ impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
compute: F)
|
||||
-> R
|
||||
where
|
||||
F: for<'b, 'lcx> FnOnce(TyCtxt<'lcx, 'gcx, 'lcx>) -> R
|
||||
F: for<'lcx> FnOnce(TyCtxt<'lcx, 'gcx, 'lcx>) -> R
|
||||
{
|
||||
// The TyCtxt stored in TLS has the same global interner lifetime
|
||||
// as `self`, so we use `with_related_context` to relate the 'gcx lifetimes
|
||||
|
@ -4,24 +4,24 @@ use crate::ty::util::NeedsDrop;
|
||||
use syntax::symbol::InternedString;
|
||||
|
||||
pub(super) trait Value<'tcx>: Sized {
|
||||
fn from_cycle_error<'a>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Self;
|
||||
fn from_cycle_error(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Self;
|
||||
}
|
||||
|
||||
impl<'tcx, T> Value<'tcx> for T {
|
||||
default fn from_cycle_error<'a>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> T {
|
||||
default fn from_cycle_error(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> T {
|
||||
tcx.sess.abort_if_errors();
|
||||
bug!("Value::from_cycle_error called without errors");
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> Value<'tcx> for Ty<'tcx> {
|
||||
fn from_cycle_error<'a>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Ty<'tcx> {
|
||||
fn from_cycle_error(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Ty<'tcx> {
|
||||
tcx.types.err
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> Value<'tcx> for ty::SymbolName {
|
||||
fn from_cycle_error<'a>(_: TyCtxt<'tcx, 'tcx, 'tcx>) -> Self {
|
||||
fn from_cycle_error(_: TyCtxt<'tcx, 'tcx, 'tcx>) -> Self {
|
||||
ty::SymbolName { name: InternedString::intern("<error>") }
|
||||
}
|
||||
}
|
||||
|
@ -337,14 +337,14 @@ CloneTypeFoldableAndLiftImpls! {
|
||||
// FIXME(eddyb) replace all the uses of `Option::map` with `?`.
|
||||
impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>> Lift<'tcx> for (A, B) {
|
||||
type Lifted = (A::Lifted, B::Lifted);
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.0).and_then(|a| tcx.lift(&self.1).map(|b| (a, b)))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>, C: Lift<'tcx>> Lift<'tcx> for (A, B, C) {
|
||||
type Lifted = (A::Lifted, B::Lifted, C::Lifted);
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.0).and_then(|a| {
|
||||
tcx.lift(&self.1).and_then(|b| tcx.lift(&self.2).map(|c| (a, b, c)))
|
||||
})
|
||||
@ -353,7 +353,7 @@ impl<'tcx, A: Lift<'tcx>, B: Lift<'tcx>, C: Lift<'tcx>> Lift<'tcx> for (A, B, C)
|
||||
|
||||
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Option<T> {
|
||||
type Lifted = Option<T::Lifted>;
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match *self {
|
||||
Some(ref x) => tcx.lift(x).map(Some),
|
||||
None => Some(None)
|
||||
@ -363,7 +363,7 @@ impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Option<T> {
|
||||
|
||||
impl<'tcx, T: Lift<'tcx>, E: Lift<'tcx>> Lift<'tcx> for Result<T, E> {
|
||||
type Lifted = Result<T::Lifted, E::Lifted>;
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match *self {
|
||||
Ok(ref x) => tcx.lift(x).map(Ok),
|
||||
Err(ref e) => tcx.lift(e).map(Err)
|
||||
@ -373,14 +373,14 @@ impl<'tcx, T: Lift<'tcx>, E: Lift<'tcx>> Lift<'tcx> for Result<T, E> {
|
||||
|
||||
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Box<T> {
|
||||
type Lifted = Box<T::Lifted>;
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&**self).map(Box::new)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for [T] {
|
||||
type Lifted = Vec<T::Lifted>;
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
// type annotation needed to inform `projection_must_outlive`
|
||||
let mut result : Vec<<T as Lift<'tcx>>::Lifted>
|
||||
= Vec::with_capacity(self.len());
|
||||
@ -397,14 +397,14 @@ impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for [T] {
|
||||
|
||||
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Vec<T> {
|
||||
type Lifted = Vec<T::Lifted>;
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self[..])
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx, I: Idx, T: Lift<'tcx>> Lift<'tcx> for IndexVec<I, T> {
|
||||
type Lifted = IndexVec<I, T::Lifted>;
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
self.iter()
|
||||
.map(|e| tcx.lift(e))
|
||||
.collect()
|
||||
@ -413,7 +413,7 @@ impl<'tcx, I: Idx, T: Lift<'tcx>> Lift<'tcx> for IndexVec<I, T> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::TraitRef<'a> {
|
||||
type Lifted = ty::TraitRef<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.substs).map(|substs| ty::TraitRef {
|
||||
def_id: self.def_id,
|
||||
substs,
|
||||
@ -423,7 +423,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::TraitRef<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::ExistentialTraitRef<'a> {
|
||||
type Lifted = ty::ExistentialTraitRef<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.substs).map(|substs| ty::ExistentialTraitRef {
|
||||
def_id: self.def_id,
|
||||
substs,
|
||||
@ -433,7 +433,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::ExistentialTraitRef<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::ExistentialPredicate<'a> {
|
||||
type Lifted = ty::ExistentialPredicate<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match self {
|
||||
ty::ExistentialPredicate::Trait(x) => {
|
||||
tcx.lift(x).map(ty::ExistentialPredicate::Trait)
|
||||
@ -450,7 +450,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::ExistentialPredicate<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::TraitPredicate<'a> {
|
||||
type Lifted = ty::TraitPredicate<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>)
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>)
|
||||
-> Option<ty::TraitPredicate<'tcx>> {
|
||||
tcx.lift(&self.trait_ref).map(|trait_ref| ty::TraitPredicate {
|
||||
trait_ref,
|
||||
@ -460,7 +460,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::TraitPredicate<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::SubtypePredicate<'a> {
|
||||
type Lifted = ty::SubtypePredicate<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>)
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>)
|
||||
-> Option<ty::SubtypePredicate<'tcx>> {
|
||||
tcx.lift(&(self.a, self.b)).map(|(a, b)| ty::SubtypePredicate {
|
||||
a_is_expected: self.a_is_expected,
|
||||
@ -472,14 +472,14 @@ impl<'a, 'tcx> Lift<'tcx> for ty::SubtypePredicate<'a> {
|
||||
|
||||
impl<'tcx, A: Copy+Lift<'tcx>, B: Copy+Lift<'tcx>> Lift<'tcx> for ty::OutlivesPredicate<A, B> {
|
||||
type Lifted = ty::OutlivesPredicate<A::Lifted, B::Lifted>;
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&(self.0, self.1)).map(|(a, b)| ty::OutlivesPredicate(a, b))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::ProjectionTy<'a> {
|
||||
type Lifted = ty::ProjectionTy<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>)
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>)
|
||||
-> Option<ty::ProjectionTy<'tcx>> {
|
||||
tcx.lift(&self.substs).map(|substs| {
|
||||
ty::ProjectionTy {
|
||||
@ -492,7 +492,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::ProjectionTy<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::ProjectionPredicate<'a> {
|
||||
type Lifted = ty::ProjectionPredicate<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>)
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>)
|
||||
-> Option<ty::ProjectionPredicate<'tcx>> {
|
||||
tcx.lift(&(self.projection_ty, self.ty)).map(|(projection_ty, ty)| {
|
||||
ty::ProjectionPredicate {
|
||||
@ -505,7 +505,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::ProjectionPredicate<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::ExistentialProjection<'a> {
|
||||
type Lifted = ty::ExistentialProjection<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.substs).map(|substs| {
|
||||
ty::ExistentialProjection {
|
||||
substs,
|
||||
@ -518,7 +518,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::ExistentialProjection<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::Predicate<'a> {
|
||||
type Lifted = ty::Predicate<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match *self {
|
||||
ty::Predicate::Trait(ref binder) => {
|
||||
tcx.lift(binder).map(ty::Predicate::Trait)
|
||||
@ -558,14 +558,14 @@ impl<'a, 'tcx> Lift<'tcx> for ty::Predicate<'a> {
|
||||
|
||||
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for ty::Binder<T> {
|
||||
type Lifted = ty::Binder<T::Lifted>;
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(self.skip_binder()).map(ty::Binder::bind)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::ParamEnv<'a> {
|
||||
type Lifted = ty::ParamEnv<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.caller_bounds).map(|caller_bounds| {
|
||||
ty::ParamEnv {
|
||||
reveal: self.reveal,
|
||||
@ -578,7 +578,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::ParamEnv<'a> {
|
||||
|
||||
impl<'a, 'tcx, T: Lift<'tcx>> Lift<'tcx> for ty::ParamEnvAnd<'a, T> {
|
||||
type Lifted = ty::ParamEnvAnd<'tcx, T::Lifted>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.param_env).and_then(|param_env| {
|
||||
tcx.lift(&self.value).map(|value| {
|
||||
ty::ParamEnvAnd {
|
||||
@ -592,7 +592,7 @@ impl<'a, 'tcx, T: Lift<'tcx>> Lift<'tcx> for ty::ParamEnvAnd<'a, T> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::ClosureSubsts<'a> {
|
||||
type Lifted = ty::ClosureSubsts<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.substs).map(|substs| {
|
||||
ty::ClosureSubsts { substs }
|
||||
})
|
||||
@ -601,7 +601,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::ClosureSubsts<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::GeneratorSubsts<'a> {
|
||||
type Lifted = ty::GeneratorSubsts<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.substs).map(|substs| {
|
||||
ty::GeneratorSubsts { substs }
|
||||
})
|
||||
@ -610,7 +610,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::GeneratorSubsts<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::adjustment::Adjustment<'a> {
|
||||
type Lifted = ty::adjustment::Adjustment<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.kind).and_then(|kind| {
|
||||
tcx.lift(&self.target).map(|target| {
|
||||
ty::adjustment::Adjustment { kind, target }
|
||||
@ -621,7 +621,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::adjustment::Adjustment<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::adjustment::Adjust<'a> {
|
||||
type Lifted = ty::adjustment::Adjust<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match *self {
|
||||
ty::adjustment::Adjust::NeverToAny =>
|
||||
Some(ty::adjustment::Adjust::NeverToAny),
|
||||
@ -639,7 +639,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::adjustment::Adjust<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::adjustment::OverloadedDeref<'a> {
|
||||
type Lifted = ty::adjustment::OverloadedDeref<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.region).map(|region| {
|
||||
ty::adjustment::OverloadedDeref {
|
||||
region,
|
||||
@ -651,7 +651,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::adjustment::OverloadedDeref<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::adjustment::AutoBorrow<'a> {
|
||||
type Lifted = ty::adjustment::AutoBorrow<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match *self {
|
||||
ty::adjustment::AutoBorrow::Ref(r, m) => {
|
||||
tcx.lift(&r).map(|r| ty::adjustment::AutoBorrow::Ref(r, m))
|
||||
@ -665,7 +665,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::adjustment::AutoBorrow<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::GenSig<'a> {
|
||||
type Lifted = ty::GenSig<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&(self.yield_ty, self.return_ty))
|
||||
.map(|(yield_ty, return_ty)| {
|
||||
ty::GenSig {
|
||||
@ -678,7 +678,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::GenSig<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::FnSig<'a> {
|
||||
type Lifted = ty::FnSig<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.inputs_and_output).map(|x| {
|
||||
ty::FnSig {
|
||||
inputs_and_output: x,
|
||||
@ -692,7 +692,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::FnSig<'a> {
|
||||
|
||||
impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for ty::error::ExpectedFound<T> {
|
||||
type Lifted = ty::error::ExpectedFound<T::Lifted>;
|
||||
fn lift_to_tcx<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
tcx.lift(&self.expected).and_then(|expected| {
|
||||
tcx.lift(&self.found).map(|found| {
|
||||
ty::error::ExpectedFound {
|
||||
@ -706,7 +706,7 @@ impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for ty::error::ExpectedFound<T> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::error::TypeError<'a> {
|
||||
type Lifted = ty::error::TypeError<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
use crate::ty::error::TypeError::*;
|
||||
|
||||
Some(match *self {
|
||||
@ -743,7 +743,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::error::TypeError<'a> {
|
||||
|
||||
impl<'a, 'tcx> Lift<'tcx> for ty::InstanceDef<'a> {
|
||||
type Lifted = ty::InstanceDef<'tcx>;
|
||||
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match *self {
|
||||
ty::InstanceDef::Item(def_id) =>
|
||||
Some(ty::InstanceDef::Item(def_id)),
|
||||
|
@ -590,7 +590,7 @@ pub enum ExistentialPredicate<'tcx> {
|
||||
AutoTrait(DefId),
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> ExistentialPredicate<'tcx> {
|
||||
impl<'gcx, 'tcx> ExistentialPredicate<'tcx> {
|
||||
/// Compares via an ordering that will not change if modules are reordered or other changes are
|
||||
/// made to the tree. In particular, this ordering is preserved across incremental compilations.
|
||||
pub fn stable_cmp(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>, other: &Self) -> Ordering {
|
||||
@ -610,7 +610,7 @@ impl<'a, 'gcx, 'tcx> ExistentialPredicate<'tcx> {
|
||||
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> Binder<ExistentialPredicate<'tcx>> {
|
||||
impl<'gcx, 'tcx> Binder<ExistentialPredicate<'tcx>> {
|
||||
pub fn with_self_ty(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>, self_ty: Ty<'tcx>)
|
||||
-> ty::Predicate<'tcx> {
|
||||
use crate::ty::ToPredicate;
|
||||
@ -744,7 +744,7 @@ impl<'tcx> TraitRef<'tcx> {
|
||||
|
||||
/// Returns a `TraitRef` of the form `P0: Foo<P1..Pn>` where `Pi`
|
||||
/// are the parameters defined on trait.
|
||||
pub fn identity<'a, 'gcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>, def_id: DefId) -> TraitRef<'tcx> {
|
||||
pub fn identity<'gcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>, def_id: DefId) -> TraitRef<'tcx> {
|
||||
TraitRef {
|
||||
def_id,
|
||||
substs: InternalSubsts::identity_for_item(tcx, def_id),
|
||||
@ -808,7 +808,7 @@ pub struct ExistentialTraitRef<'tcx> {
|
||||
pub substs: SubstsRef<'tcx>,
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> ExistentialTraitRef<'tcx> {
|
||||
impl<'gcx, 'tcx> ExistentialTraitRef<'tcx> {
|
||||
pub fn input_types<'b>(&'b self) -> impl DoubleEndedIterator<Item=Ty<'tcx>> + 'b {
|
||||
// Select only the "input types" from a trait-reference. For
|
||||
// now this is all the types that appear in the
|
||||
@ -1112,7 +1112,7 @@ pub struct ParamTy {
|
||||
pub name: InternedString,
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> ParamTy {
|
||||
impl<'gcx, 'tcx> ParamTy {
|
||||
pub fn new(index: u32, name: InternedString) -> ParamTy {
|
||||
ParamTy { index, name: name }
|
||||
}
|
||||
@ -1144,7 +1144,7 @@ pub struct ParamConst {
|
||||
pub name: InternedString,
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> ParamConst {
|
||||
impl<'gcx, 'tcx> ParamConst {
|
||||
pub fn new(index: u32, name: InternedString) -> ParamConst {
|
||||
ParamConst { index, name }
|
||||
}
|
||||
@ -1408,7 +1408,7 @@ pub struct ExistentialProjection<'tcx> {
|
||||
|
||||
pub type PolyExistentialProjection<'tcx> = Binder<ExistentialProjection<'tcx>>;
|
||||
|
||||
impl<'a, 'tcx, 'gcx> ExistentialProjection<'tcx> {
|
||||
impl<'tcx, 'gcx> ExistentialProjection<'tcx> {
|
||||
/// Extracts the underlying existential trait reference from this projection.
|
||||
/// For example, if this is a projection of `exists T. <T as Iterator>::Item == X`,
|
||||
/// then this function would return a `exists T. T: Iterator` existential trait
|
||||
@ -1438,7 +1438,7 @@ impl<'a, 'tcx, 'gcx> ExistentialProjection<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx, 'gcx> PolyExistentialProjection<'tcx> {
|
||||
impl<'tcx, 'gcx> PolyExistentialProjection<'tcx> {
|
||||
pub fn with_self_ty(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>, self_ty: Ty<'tcx>)
|
||||
-> ty::PolyProjectionPredicate<'tcx> {
|
||||
self.map_bound(|p| p.with_self_ty(tcx, self_ty))
|
||||
@ -1664,7 +1664,7 @@ impl RegionKind {
|
||||
}
|
||||
|
||||
/// Type utilities
|
||||
impl<'a, 'gcx, 'tcx> TyS<'tcx> {
|
||||
impl<'gcx, 'tcx> TyS<'tcx> {
|
||||
#[inline]
|
||||
pub fn is_unit(&self) -> bool {
|
||||
match self.sty {
|
||||
|
@ -138,7 +138,7 @@ impl<'tcx> Kind<'tcx> {
|
||||
impl<'a, 'tcx> Lift<'tcx> for Kind<'a> {
|
||||
type Lifted = Kind<'tcx>;
|
||||
|
||||
fn lift_to_tcx<'cx, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<Self::Lifted> {
|
||||
match self.unpack() {
|
||||
UnpackedKind::Lifetime(lt) => tcx.lift(<).map(|lt| lt.into()),
|
||||
UnpackedKind::Type(ty) => tcx.lift(&ty).map(|ty| ty.into()),
|
||||
@ -414,19 +414,19 @@ impl<'tcx> serialize::UseSpecializedDecodable for SubstsRef<'tcx> {}
|
||||
// there is more information available (for better errors).
|
||||
|
||||
pub trait Subst<'tcx>: Sized {
|
||||
fn subst<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
fn subst<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
substs: &[Kind<'tcx>]) -> Self {
|
||||
self.subst_spanned(tcx, substs, None)
|
||||
}
|
||||
|
||||
fn subst_spanned<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
fn subst_spanned<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
substs: &[Kind<'tcx>],
|
||||
span: Option<Span>)
|
||||
-> Self;
|
||||
}
|
||||
|
||||
impl<'tcx, T:TypeFoldable<'tcx>> Subst<'tcx> for T {
|
||||
fn subst_spanned<'a, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
fn subst_spanned<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
substs: &[Kind<'tcx>],
|
||||
span: Option<Span>)
|
||||
-> T
|
||||
|
@ -46,7 +46,7 @@ pub struct TraitImpls {
|
||||
non_blanket_impls: FxHashMap<fast_reject::SimplifiedType, Vec<DefId>>,
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TraitDef {
|
||||
impl<'gcx, 'tcx> TraitDef {
|
||||
pub fn new(def_id: DefId,
|
||||
unsafety: hir::Unsafety,
|
||||
paren_sugar: bool,
|
||||
@ -71,7 +71,7 @@ impl<'a, 'gcx, 'tcx> TraitDef {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
pub fn for_each_impl<F: FnMut(DefId)>(self, def_id: DefId, mut f: F) {
|
||||
let impls = self.trait_impls_of(def_id);
|
||||
|
||||
@ -148,7 +148,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
}
|
||||
|
||||
// Query provider for `trait_impls_of`.
|
||||
pub(super) fn trait_impls_of_provider<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
pub(super) fn trait_impls_of_provider<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
trait_id: DefId)
|
||||
-> &'tcx TraitImpls {
|
||||
let mut impls = TraitImpls::default();
|
||||
|
@ -51,10 +51,10 @@ impl<'tcx> fmt::Display for Discr<'tcx> {
|
||||
|
||||
impl<'tcx> Discr<'tcx> {
|
||||
/// Adds `1` to the value and wraps around if the maximum for the type is reached.
|
||||
pub fn wrap_incr<'a, 'gcx>(self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Self {
|
||||
pub fn wrap_incr<'gcx>(self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Self {
|
||||
self.checked_add(tcx, 1).0
|
||||
}
|
||||
pub fn checked_add<'a, 'gcx>(self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>, n: u128) -> (Self, bool) {
|
||||
pub fn checked_add<'gcx>(self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>, n: u128) -> (Self, bool) {
|
||||
let (int, signed) = match self.ty.sty {
|
||||
Int(ity) => (Integer::from_attr(&tcx, SignedInt(ity)), true),
|
||||
Uint(uty) => (Integer::from_attr(&tcx, UnsignedInt(uty)), false),
|
||||
@ -104,14 +104,14 @@ impl<'tcx> Discr<'tcx> {
|
||||
}
|
||||
|
||||
pub trait IntTypeExt {
|
||||
fn to_ty<'a, 'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx>;
|
||||
fn disr_incr<'a, 'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>, val: Option<Discr<'tcx>>)
|
||||
fn to_ty<'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx>;
|
||||
fn disr_incr<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>, val: Option<Discr<'tcx>>)
|
||||
-> Option<Discr<'tcx>>;
|
||||
fn initial_discriminant<'a, 'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Discr<'tcx>;
|
||||
fn initial_discriminant<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Discr<'tcx>;
|
||||
}
|
||||
|
||||
impl IntTypeExt for attr::IntType {
|
||||
fn to_ty<'a, 'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
|
||||
fn to_ty<'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
|
||||
match *self {
|
||||
SignedInt(ast::IntTy::I8) => tcx.types.i8,
|
||||
SignedInt(ast::IntTy::I16) => tcx.types.i16,
|
||||
@ -128,14 +128,14 @@ impl IntTypeExt for attr::IntType {
|
||||
}
|
||||
}
|
||||
|
||||
fn initial_discriminant<'a, 'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Discr<'tcx> {
|
||||
fn initial_discriminant<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Discr<'tcx> {
|
||||
Discr {
|
||||
val: 0,
|
||||
ty: self.to_ty(tcx)
|
||||
}
|
||||
}
|
||||
|
||||
fn disr_incr<'a, 'tcx>(
|
||||
fn disr_incr<'tcx>(
|
||||
&self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
val: Option<Discr<'tcx>>,
|
||||
@ -178,7 +178,7 @@ pub enum Representability {
|
||||
}
|
||||
|
||||
impl<'tcx> ty::ParamEnv<'tcx> {
|
||||
pub fn can_type_implement_copy<'a>(self,
|
||||
pub fn can_type_implement_copy(self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
self_type: Ty<'tcx>)
|
||||
-> Result<(), CopyImplementationError<'tcx>> {
|
||||
@ -228,7 +228,7 @@ impl<'tcx> ty::ParamEnv<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
impl<'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
/// Creates a hash of the type `Ty` which will be the same no matter what crate
|
||||
/// context it's calculated within. This is used by the `type_id` intrinsic.
|
||||
pub fn type_id_hash(self, ty: Ty<'tcx>) -> u64 {
|
||||
@ -249,7 +249,7 @@ impl<'a, 'tcx> TyCtxt<'tcx, 'tcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
pub fn has_error_field(self, ty: Ty<'tcx>) -> bool {
|
||||
if let ty::Adt(def, substs) = ty.sty {
|
||||
for field in def.all_fields() {
|
||||
@ -687,7 +687,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> ty::TyS<'tcx> {
|
||||
impl<'tcx> ty::TyS<'tcx> {
|
||||
/// Checks whether values of this type `T` are *moved* or *copied*
|
||||
/// when referenced -- this amounts to a check for whether `T:
|
||||
/// Copy`, but note that we **don't** consider lifetimes when
|
||||
@ -778,7 +778,7 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
|
||||
})
|
||||
}
|
||||
|
||||
fn are_inner_types_recursive<'a, 'tcx>(
|
||||
fn are_inner_types_recursive<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>, sp: Span,
|
||||
seen: &mut Vec<Ty<'tcx>>,
|
||||
representable_cache: &mut FxHashMap<Ty<'tcx>, Representability>,
|
||||
@ -838,7 +838,7 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
|
||||
|
||||
// Does the type `ty` directly (without indirection through a pointer)
|
||||
// contain any types on stack `seen`?
|
||||
fn is_type_structurally_recursive<'a, 'tcx>(
|
||||
fn is_type_structurally_recursive<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
sp: Span,
|
||||
seen: &mut Vec<Ty<'tcx>>,
|
||||
@ -859,7 +859,7 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
|
||||
representability
|
||||
}
|
||||
|
||||
fn is_type_structurally_recursive_inner<'a, 'tcx>(
|
||||
fn is_type_structurally_recursive_inner<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
sp: Span,
|
||||
seen: &mut Vec<Ty<'tcx>>,
|
||||
@ -937,7 +937,7 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_copy_raw<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn is_copy_raw<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
|
||||
-> bool
|
||||
{
|
||||
@ -953,7 +953,7 @@ fn is_copy_raw<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
))
|
||||
}
|
||||
|
||||
fn is_sized_raw<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn is_sized_raw<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
|
||||
-> bool
|
||||
{
|
||||
@ -969,7 +969,7 @@ fn is_sized_raw<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
))
|
||||
}
|
||||
|
||||
fn is_freeze_raw<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn is_freeze_raw<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
|
||||
-> bool
|
||||
{
|
||||
@ -988,7 +988,7 @@ fn is_freeze_raw<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
#[derive(Clone, HashStable)]
|
||||
pub struct NeedsDrop(pub bool);
|
||||
|
||||
fn needs_drop_raw<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn needs_drop_raw<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>)
|
||||
-> NeedsDrop
|
||||
{
|
||||
|
@ -508,7 +508,7 @@ impl<'a, 'gcx, 'tcx> WfPredicates<'a, 'gcx, 'tcx> {
|
||||
/// they declare `trait SomeTrait : 'static`, for example, then
|
||||
/// `'static` would appear in the list. The hard work is done by
|
||||
/// `ty::required_region_bounds`, see that for more information.
|
||||
pub fn object_region_bounds<'a, 'gcx, 'tcx>(
|
||||
pub fn object_region_bounds<'gcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
existential_predicates: ty::Binder<&'tcx ty::List<ty::ExistentialPredicate<'tcx>>>)
|
||||
-> Vec<ty::Region<'tcx>>
|
||||
|
@ -179,7 +179,7 @@ impl<'a, 'tcx> euv::Delegate<'tcx> for CheckLoanCtxt<'a, 'tcx> {
|
||||
fn decl_without_init(&mut self, _id: hir::HirId, _span: Span) { }
|
||||
}
|
||||
|
||||
pub fn check_loans<'a, 'b, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
pub fn check_loans<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
||||
dfcx_loans: &LoanDataFlow<'tcx>,
|
||||
move_data: &move_data::FlowedMoveData<'tcx>,
|
||||
all_loans: &[Loan<'tcx>],
|
||||
|
@ -45,7 +45,7 @@ pub enum PatternSource<'tcx> {
|
||||
///
|
||||
/// In this latter case, this function will return `PatternSource::LetDecl`
|
||||
/// with a reference to the let
|
||||
fn get_pattern_source<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, pat: &Pat) -> PatternSource<'tcx> {
|
||||
fn get_pattern_source<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, pat: &Pat) -> PatternSource<'tcx> {
|
||||
|
||||
let parent = tcx.hir().get_parent_node_by_hir_id(pat.hir_id);
|
||||
|
||||
|
@ -53,7 +53,7 @@ pub struct LoanDataFlowOperator;
|
||||
|
||||
pub type LoanDataFlow<'tcx> = DataFlowContext<'tcx, LoanDataFlowOperator>;
|
||||
|
||||
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn check_crate<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
tcx.par_body_owners(|body_owner_def_id| {
|
||||
tcx.ensure().borrowck(body_owner_def_id);
|
||||
});
|
||||
@ -73,7 +73,7 @@ pub struct AnalysisData<'tcx> {
|
||||
pub move_data: move_data::FlowedMoveData<'tcx>,
|
||||
}
|
||||
|
||||
fn borrowck<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, owner_def_id: DefId)
|
||||
fn borrowck<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, owner_def_id: DefId)
|
||||
-> &'tcx BorrowCheckResult
|
||||
{
|
||||
assert!(tcx.use_ast_borrowck() || tcx.migrate_borrowck());
|
||||
|
@ -91,14 +91,14 @@ fn get_cfg_indices<'a>(id: hir::ItemLocalId,
|
||||
index.get(&id).map_or(&[], |v| &v[..])
|
||||
}
|
||||
|
||||
impl<'a, 'tcx, O: DataFlowOperator> DataFlowContext<'tcx, O> {
|
||||
impl<'tcx, O: DataFlowOperator> DataFlowContext<'tcx, O> {
|
||||
fn has_bitset_for_local_id(&self, n: hir::ItemLocalId) -> bool {
|
||||
assert!(n != hir::DUMMY_ITEM_LOCAL_ID);
|
||||
self.local_id_to_index.contains_key(&n)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx, O:DataFlowOperator> pprust::PpAnn for DataFlowContext<'tcx, O> {
|
||||
impl<'tcx, O:DataFlowOperator> pprust::PpAnn for DataFlowContext<'tcx, O> {
|
||||
fn nested(&self, state: &mut pprust::State<'_>, nested: pprust::Nested) -> io::Result<()> {
|
||||
pprust::PpAnn::nested(self.tcx.hir(), state, nested)
|
||||
}
|
||||
@ -224,7 +224,7 @@ pub enum KillFrom {
|
||||
Execution,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx, O: DataFlowOperator> DataFlowContext<'tcx, O> {
|
||||
impl<'tcx, O: DataFlowOperator> DataFlowContext<'tcx, O> {
|
||||
pub fn new(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
analysis_name: &'static str,
|
||||
body: Option<&hir::Body>,
|
||||
@ -500,7 +500,7 @@ impl<'a, 'tcx, O: DataFlowOperator> DataFlowContext<'tcx, O> {
|
||||
}
|
||||
|
||||
// N.B. `Clone + 'static` only needed for pretty printing.
|
||||
impl<'a, 'tcx, O: DataFlowOperator + Clone + 'static> DataFlowContext<'tcx, O> {
|
||||
impl<'tcx, O: DataFlowOperator + Clone + 'static> DataFlowContext<'tcx, O> {
|
||||
pub fn propagate(&mut self, cfg: &cfg::CFG, body: &hir::Body) {
|
||||
//! Performs the data flow analysis.
|
||||
|
||||
|
@ -46,7 +46,7 @@ pub fn crates_export_threshold(crate_types: &[config::CrateType]) -> SymbolExpor
|
||||
}
|
||||
}
|
||||
|
||||
fn reachable_non_generics_provider<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn reachable_non_generics_provider<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
cnum: CrateNum)
|
||||
-> &'tcx DefIdMap<SymbolExportLevel>
|
||||
{
|
||||
@ -157,7 +157,7 @@ fn reachable_non_generics_provider<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
tcx.arena.alloc(reachable_non_generics)
|
||||
}
|
||||
|
||||
fn is_reachable_non_generic_provider_local<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn is_reachable_non_generic_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
def_id: DefId)
|
||||
-> bool {
|
||||
let export_threshold = threshold(tcx);
|
||||
@ -169,13 +169,13 @@ fn is_reachable_non_generic_provider_local<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tc
|
||||
}
|
||||
}
|
||||
|
||||
fn is_reachable_non_generic_provider_extern<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn is_reachable_non_generic_provider_extern<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
def_id: DefId)
|
||||
-> bool {
|
||||
tcx.reachable_non_generics(def_id.krate).contains_key(&def_id)
|
||||
}
|
||||
|
||||
fn exported_symbols_provider_local<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn exported_symbols_provider_local<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
cnum: CrateNum)
|
||||
-> Arc<Vec<(ExportedSymbol<'tcx>,
|
||||
SymbolExportLevel)>>
|
||||
@ -278,7 +278,7 @@ fn exported_symbols_provider_local<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
Arc::new(symbols)
|
||||
}
|
||||
|
||||
fn upstream_monomorphizations_provider<'a, 'tcx>(
|
||||
fn upstream_monomorphizations_provider<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
cnum: CrateNum)
|
||||
-> &'tcx DefIdMap<FxHashMap<SubstsRef<'tcx>, CrateNum>>
|
||||
@ -328,7 +328,7 @@ fn upstream_monomorphizations_provider<'a, 'tcx>(
|
||||
tcx.arena.alloc(instances)
|
||||
}
|
||||
|
||||
fn upstream_monomorphizations_for_provider<'a, 'tcx>(
|
||||
fn upstream_monomorphizations_for_provider<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
def_id: DefId)
|
||||
-> Option<&'tcx FxHashMap<SubstsRef<'tcx>, CrateNum>>
|
||||
|
@ -703,7 +703,7 @@ impl<B: ExtraBackendMethods> Drop for AbortCodegenOnDrop<B> {
|
||||
}
|
||||
}
|
||||
|
||||
fn assert_and_save_dep_graph<'ll, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
fn assert_and_save_dep_graph<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
time(tcx.sess,
|
||||
"assert dep graph",
|
||||
|| ::rustc_incremental::assert_dep_graph(tcx));
|
||||
@ -850,7 +850,7 @@ pub fn provide_both(providers: &mut Providers<'_>) {
|
||||
};
|
||||
}
|
||||
|
||||
fn determine_cgu_reuse<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
cgu: &CodegenUnit<'tcx>)
|
||||
-> CguReuse {
|
||||
if !tcx.dep_graph.is_fully_enabled() {
|
||||
|
@ -8,7 +8,7 @@ use rustc_data_structures::fx::FxHashSet;
|
||||
// any caching, i.e., calling the function twice with the same type will also do
|
||||
// the work twice. The `qualified` parameter only affects the first level of the
|
||||
// type name, further levels (i.e., type parameters) are always fully qualified.
|
||||
pub fn compute_debuginfo_type_name<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
pub fn compute_debuginfo_type_name<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
t: Ty<'tcx>,
|
||||
qualified: bool)
|
||||
-> String {
|
||||
@ -20,7 +20,7 @@ pub fn compute_debuginfo_type_name<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
|
||||
// Pushes the name of the type as it should be stored in debuginfo on the
|
||||
// `output` String. See also compute_debuginfo_type_name().
|
||||
pub fn push_debuginfo_type_name<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
pub fn push_debuginfo_type_name<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
t: Ty<'tcx>,
|
||||
qualified: bool,
|
||||
output: &mut String,
|
||||
@ -228,7 +228,7 @@ pub fn push_debuginfo_type_name<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
// reconstructed for items from non-local crates. For local crates, this
|
||||
// would be possible but with inlining and LTO we have to use the least
|
||||
// common denominator - otherwise we would run into conflicts.
|
||||
fn push_type_params<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn push_type_params<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
substs: SubstsRef<'tcx>,
|
||||
output: &mut String,
|
||||
visited: &mut FxHashSet<Ty<'tcx>>) {
|
||||
|
@ -32,13 +32,13 @@ impl<'tcx, T> Backend<'tcx> for T where
|
||||
|
||||
pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Send {
|
||||
fn new_metadata(&self, sess: TyCtxt<'_, '_, '_>, mod_name: &str) -> Self::Module;
|
||||
fn write_compressed_metadata<'b, 'gcx>(
|
||||
fn write_compressed_metadata<'gcx>(
|
||||
&self,
|
||||
tcx: TyCtxt<'gcx, 'gcx, 'gcx>,
|
||||
metadata: &EncodedMetadata,
|
||||
llvm_module: &mut Self::Module,
|
||||
);
|
||||
fn codegen_allocator<'b, 'gcx>(
|
||||
fn codegen_allocator<'gcx>(
|
||||
&self,
|
||||
tcx: TyCtxt<'gcx, 'gcx, 'gcx>,
|
||||
mods: &mut Self::Module,
|
||||
|
@ -34,7 +34,7 @@ pub trait CodegenBackend {
|
||||
fn metadata_loader(&self) -> Box<dyn MetadataLoader + Sync>;
|
||||
fn provide(&self, _providers: &mut Providers<'_>);
|
||||
fn provide_extern(&self, _providers: &mut Providers<'_>);
|
||||
fn codegen_crate<'a, 'tcx>(
|
||||
fn codegen_crate<'tcx>(
|
||||
&self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
metadata: EncodedMetadata,
|
||||
|
@ -68,7 +68,7 @@ pub(super) fn mangle(
|
||||
printer.path.finish(hash)
|
||||
}
|
||||
|
||||
fn get_symbol_hash<'a, 'tcx>(
|
||||
fn get_symbol_hash<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
|
||||
// instance this name will be for
|
||||
|
@ -11,7 +11,7 @@ use syntax::symbol::{Symbol, sym};
|
||||
const SYMBOL_NAME: Symbol = sym::rustc_symbol_name;
|
||||
const DEF_PATH: Symbol = sym::rustc_def_path;
|
||||
|
||||
pub fn report_symbol_names<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn report_symbol_names<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
// if the `rustc_attrs` feature is not enabled, then the
|
||||
// attributes we are interested in cannot be present anyway, so
|
||||
// skip the walk.
|
||||
|
@ -617,7 +617,7 @@ impl UserIdentifiedItem {
|
||||
}
|
||||
}
|
||||
|
||||
fn print_flowgraph<'a, 'tcx, W: Write>(variants: Vec<borrowck_dot::Variant>,
|
||||
fn print_flowgraph<'tcx, W: Write>(variants: Vec<borrowck_dot::Variant>,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
code: blocks::Code<'tcx>,
|
||||
mode: PpFlowGraphMode,
|
||||
|
@ -51,7 +51,7 @@ use std::io::Write;
|
||||
use syntax::ast;
|
||||
use syntax_pos::Span;
|
||||
|
||||
pub fn assert_dep_graph<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn assert_dep_graph<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
tcx.dep_graph.with_ignore(|| {
|
||||
if tcx.sess.opts.debugging_opts.dump_dep_graph {
|
||||
dump_graph(tcx);
|
||||
@ -184,7 +184,7 @@ impl Visitor<'tcx> for IfThisChanged<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn check_paths<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn check_paths<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
if_this_changed: &Sources,
|
||||
then_this_would_need: &Targets)
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ const MODULE: Symbol = sym::module;
|
||||
const CFG: Symbol = sym::cfg;
|
||||
const KIND: Symbol = sym::kind;
|
||||
|
||||
pub fn assert_module_sources<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn assert_module_sources<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
tcx.dep_graph.with_ignore(|| {
|
||||
if tcx.sess.opts.incremental.is_none() {
|
||||
return;
|
||||
|
@ -206,7 +206,7 @@ impl Assertion {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn check_dirty_clean_annotations<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn check_dirty_clean_annotations<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
// can't add `#[rustc_dirty]` etc without opting in to this feature
|
||||
if !tcx.features().rustc_attrs {
|
||||
return;
|
||||
|
@ -15,7 +15,7 @@ use super::fs::*;
|
||||
use super::file_format;
|
||||
use super::work_product;
|
||||
|
||||
pub fn dep_graph_tcx_init<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn dep_graph_tcx_init<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
if !tcx.dep_graph.is_fully_enabled() {
|
||||
return
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ use super::dirty_clean;
|
||||
use super::file_format;
|
||||
use super::work_product;
|
||||
|
||||
pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
pub fn save_dep_graph<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
|
||||
debug!("save_dep_graph()");
|
||||
tcx.dep_graph.with_ignore(|| {
|
||||
let sess = tcx.sess;
|
||||
|
@ -519,11 +519,11 @@ enum FfiResult<'tcx> {
|
||||
},
|
||||
}
|
||||
|
||||
fn is_zst<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, did: DefId, ty: Ty<'tcx>) -> bool {
|
||||
fn is_zst<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, did: DefId, ty: Ty<'tcx>) -> bool {
|
||||
tcx.layout_of(tcx.param_env(did).and(ty)).map(|layout| layout.is_zst()).unwrap_or(false)
|
||||
}
|
||||
|
||||
fn ty_is_known_nonnull<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
|
||||
fn ty_is_known_nonnull<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
|
||||
match ty.sty {
|
||||
ty::FnPtr(_) => true,
|
||||
ty::Ref(..) => true,
|
||||
@ -555,7 +555,7 @@ fn ty_is_known_nonnull<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, ty: Ty<'tcx>) ->
|
||||
/// to function pointers, references, core::num::NonZero*,
|
||||
/// core::ptr::NonNull, and #[repr(transparent)] newtypes.
|
||||
/// FIXME: This duplicates code in codegen.
|
||||
fn is_repr_nullable_ptr<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
fn is_repr_nullable_ptr<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
ty: Ty<'tcx>,
|
||||
ty_def: &'tcx ty::AdtDef,
|
||||
substs: SubstsRef<'tcx>)
|
||||
|
@ -550,7 +550,7 @@ impl CrateStore for cstore::CStore {
|
||||
self.do_postorder_cnums_untracked()
|
||||
}
|
||||
|
||||
fn encode_metadata<'a, 'tcx>(&self,
|
||||
fn encode_metadata<'tcx>(&self,
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>)
|
||||
-> EncodedMetadata
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ macro_rules! encoder_methods {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Encoder for EncodeContext<'tcx> {
|
||||
impl<'tcx> Encoder for EncodeContext<'tcx> {
|
||||
type Error = <opaque::Encoder as Encoder>::Error;
|
||||
|
||||
fn emit_unit(&mut self) -> Result<(), Self::Error> {
|
||||
|
@ -3,7 +3,7 @@ use rustc::hir;
|
||||
use rustc::middle::cstore::ForeignModule;
|
||||
use rustc::ty::TyCtxt;
|
||||
|
||||
pub fn collect<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Vec<ForeignModule> {
|
||||
pub fn collect<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Vec<ForeignModule> {
|
||||
let mut collector = Collector {
|
||||
tcx,
|
||||
modules: Vec::new(),
|
||||
|
@ -4,7 +4,7 @@ use rustc::ty::TyCtxt;
|
||||
use rustc_target::spec::abi::Abi;
|
||||
use syntax::symbol::sym;
|
||||
|
||||
pub fn collect<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Vec<String> {
|
||||
pub fn collect<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Vec<String> {
|
||||
let mut collector = Collector {
|
||||
args: Vec::new(),
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ use syntax::feature_gate::{self, GateIssue};
|
||||
use syntax::symbol::{Symbol, sym};
|
||||
use syntax::{span_err, struct_span_err};
|
||||
|
||||
pub fn collect<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Vec<NativeLibrary> {
|
||||
pub fn collect<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Vec<NativeLibrary> {
|
||||
let mut collector = Collector {
|
||||
tcx,
|
||||
libs: Vec::new(),
|
||||
|
@ -87,7 +87,7 @@ pub fn provide(providers: &mut Providers<'_>) {
|
||||
};
|
||||
}
|
||||
|
||||
fn mir_borrowck<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> BorrowCheckResult<'tcx> {
|
||||
fn mir_borrowck<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> BorrowCheckResult<'tcx> {
|
||||
let input_body = tcx.mir_validated(def_id);
|
||||
debug!("run query mir_borrowck: {}", tcx.def_path_str(def_id));
|
||||
|
||||
|
@ -522,7 +522,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
fn suggest_ampmut_self<'cx, 'gcx, 'tcx>(
|
||||
fn suggest_ampmut_self<'gcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
local_decl: &mir::LocalDecl<'tcx>,
|
||||
) -> (Span, String) {
|
||||
@ -555,7 +555,7 @@ fn suggest_ampmut_self<'cx, 'gcx, 'tcx>(
|
||||
//
|
||||
// This implementation attempts to emulate AST-borrowck prioritization
|
||||
// by trying (3.), then (2.) and finally falling back on (1.).
|
||||
fn suggest_ampmut<'cx, 'gcx, 'tcx>(
|
||||
fn suggest_ampmut<'gcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
local: Local,
|
||||
|
@ -51,7 +51,7 @@ impl BorrowExplanation {
|
||||
_ => true,
|
||||
}
|
||||
}
|
||||
pub(in crate::borrow_check) fn add_explanation_to_diagnostic<'cx, 'gcx, 'tcx>(
|
||||
pub(in crate::borrow_check) fn add_explanation_to_diagnostic<'gcx, 'tcx>(
|
||||
&self,
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
|
@ -17,7 +17,7 @@ use rustc::mir::TerminatorKind;
|
||||
use rustc::mir::{Operand, BorrowKind};
|
||||
use rustc_data_structures::graph::dominators::Dominators;
|
||||
|
||||
pub(super) fn generate_invalidates<'cx, 'gcx, 'tcx>(
|
||||
pub(super) fn generate_invalidates<'gcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
all_facts: &mut Option<AllFacts>,
|
||||
location_table: &LocationTable,
|
||||
|
@ -22,7 +22,7 @@ pub(super) enum Control {
|
||||
}
|
||||
|
||||
/// Encapsulates the idea of iterating over every borrow that involves a particular path
|
||||
pub(super) fn each_borrow_involving_path<'a, 'tcx, 'gcx: 'tcx, F, I, S> (
|
||||
pub(super) fn each_borrow_involving_path<'tcx, 'gcx: 'tcx, F, I, S> (
|
||||
s: &mut S,
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
|
@ -298,7 +298,7 @@ fn place_components_conflict<'gcx, 'tcx>(
|
||||
// Given that the bases of `elem1` and `elem2` are always either equal
|
||||
// or disjoint (and have the same type!), return the overlap situation
|
||||
// between `elem1` and `elem2`.
|
||||
fn place_base_conflict<'a, 'gcx: 'tcx, 'tcx>(
|
||||
fn place_base_conflict<'gcx: 'tcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
elem1: &PlaceBase<'tcx>,
|
||||
elem2: &PlaceBase<'tcx>,
|
||||
@ -365,7 +365,7 @@ fn place_base_conflict<'a, 'gcx: 'tcx, 'tcx>(
|
||||
// Given that the bases of `elem1` and `elem2` are always either equal
|
||||
// or disjoint (and have the same type!), return the overlap situation
|
||||
// between `elem1` and `elem2`.
|
||||
fn place_projection_conflict<'a, 'gcx: 'tcx, 'tcx>(
|
||||
fn place_projection_conflict<'gcx: 'tcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
pi1: &Projection<'tcx>,
|
||||
|
@ -25,7 +25,7 @@ use syntax_pos::Span;
|
||||
use super::lints;
|
||||
|
||||
/// Construct the MIR for a given `DefId`.
|
||||
pub fn mir_build<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> Body<'tcx> {
|
||||
pub fn mir_build<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) -> Body<'tcx> {
|
||||
let id = tcx.hir().as_local_hir_id(def_id).unwrap();
|
||||
|
||||
// Figure out what primary body this item has.
|
||||
@ -234,7 +234,7 @@ impl<'gcx: 'tcx, 'tcx> MutVisitor<'tcx> for GlobalizeMir<'gcx> {
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// BuildMir -- walks a crate, looking for fn items and methods to build MIR from
|
||||
|
||||
fn liberated_closure_env_ty<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
fn liberated_closure_env_ty<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
closure_expr_id: hir::HirId,
|
||||
body_id: hir::BodyId)
|
||||
-> Ty<'tcx> {
|
||||
@ -551,7 +551,7 @@ macro_rules! unpack {
|
||||
};
|
||||
}
|
||||
|
||||
fn should_abort_on_panic<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
fn should_abort_on_panic<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
fn_def_id: DefId,
|
||||
abi: Abi)
|
||||
-> bool {
|
||||
|
@ -46,7 +46,7 @@ pub fn move_path_children_matching<'tcx, F>(move_data: &MoveData<'tcx>,
|
||||
/// is no need to maintain separate drop flags to track such state.
|
||||
//
|
||||
// FIXME: we have to do something for moving slice patterns.
|
||||
fn place_contents_drop_state_cannot_differ<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
fn place_contents_drop_state_cannot_differ<'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
place: &mir::Place<'tcx>) -> bool {
|
||||
let ty = place.ty(body, tcx).ty;
|
||||
@ -72,7 +72,7 @@ fn place_contents_drop_state_cannot_differ<'a, 'gcx, 'tcx>(tcx: TyCtxt<'tcx, 'gc
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn on_lookup_result_bits<'a, 'gcx, 'tcx, F>(
|
||||
pub(crate) fn on_lookup_result_bits<'gcx, 'tcx, F>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
move_data: &MoveData<'tcx>,
|
||||
@ -90,7 +90,7 @@ pub(crate) fn on_lookup_result_bits<'a, 'gcx, 'tcx, F>(
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn on_all_children_bits<'a, 'gcx, 'tcx, F>(
|
||||
pub(crate) fn on_all_children_bits<'gcx, 'tcx, F>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
move_data: &MoveData<'tcx>,
|
||||
@ -98,7 +98,7 @@ pub(crate) fn on_all_children_bits<'a, 'gcx, 'tcx, F>(
|
||||
mut each_child: F)
|
||||
where F: FnMut(MovePathIndex)
|
||||
{
|
||||
fn is_terminal_path<'a, 'gcx, 'tcx>(
|
||||
fn is_terminal_path<'gcx, 'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
move_data: &MoveData<'tcx>,
|
||||
@ -108,7 +108,7 @@ pub(crate) fn on_all_children_bits<'a, 'gcx, 'tcx, F>(
|
||||
tcx, body, &move_data.move_paths[path].place)
|
||||
}
|
||||
|
||||
fn on_all_children_bits<'a, 'gcx, 'tcx, F>(
|
||||
fn on_all_children_bits<'gcx, 'tcx, F>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
move_data: &MoveData<'tcx>,
|
||||
@ -131,7 +131,7 @@ pub(crate) fn on_all_children_bits<'a, 'gcx, 'tcx, F>(
|
||||
on_all_children_bits(tcx, body, move_data, move_path_index, &mut each_child);
|
||||
}
|
||||
|
||||
pub(crate) fn on_all_drop_children_bits<'a, 'gcx, 'tcx, F>(
|
||||
pub(crate) fn on_all_drop_children_bits<'gcx, 'tcx, F>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
ctxt: &MoveDataParamEnv<'gcx, 'tcx>,
|
||||
@ -154,7 +154,7 @@ pub(crate) fn on_all_drop_children_bits<'a, 'gcx, 'tcx, F>(
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn drop_flag_effects_for_function_entry<'a, 'gcx, 'tcx, F>(
|
||||
pub(crate) fn drop_flag_effects_for_function_entry<'gcx, 'tcx, F>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
ctxt: &MoveDataParamEnv<'gcx, 'tcx>,
|
||||
@ -171,7 +171,7 @@ pub(crate) fn drop_flag_effects_for_function_entry<'a, 'gcx, 'tcx, F>(
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn drop_flag_effects_for_location<'a, 'gcx, 'tcx, F>(
|
||||
pub(crate) fn drop_flag_effects_for_location<'gcx, 'tcx, F>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
ctxt: &MoveDataParamEnv<'gcx, 'tcx>,
|
||||
@ -203,7 +203,7 @@ pub(crate) fn drop_flag_effects_for_location<'a, 'gcx, 'tcx, F>(
|
||||
);
|
||||
}
|
||||
|
||||
pub(crate) fn for_location_inits<'a, 'gcx, 'tcx, F>(
|
||||
pub(crate) fn for_location_inits<'gcx, 'tcx, F>(
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
body: &Body<'tcx>,
|
||||
move_data: &MoveData<'tcx>,
|
||||
|
@ -202,7 +202,7 @@ impl<'a, 'gcx, 'tcx> MoveDataBuilder<'a, 'gcx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn gather_moves<'a, 'gcx, 'tcx>(
|
||||
pub(super) fn gather_moves<'gcx, 'tcx>(
|
||||
body: &Body<'tcx>,
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>
|
||||
) -> Result<MoveData<'tcx>, (MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>)> {
|
||||
|
@ -305,7 +305,7 @@ impl<'tcx> MoveError<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'gcx, 'tcx> MoveData<'tcx> {
|
||||
impl<'gcx, 'tcx> MoveData<'tcx> {
|
||||
pub fn gather_moves(body: &Body<'tcx>, tcx: TyCtxt<'tcx, 'gcx, 'tcx>)
|
||||
-> Result<Self, (Self, Vec<(Place<'tcx>, MoveError<'tcx>)>)> {
|
||||
builder::gather_moves(body, tcx)
|
||||
|
@ -9,7 +9,7 @@ crate enum LitToConstError {
|
||||
Reported,
|
||||
}
|
||||
|
||||
crate fn lit_to_const<'a, 'gcx, 'tcx>(
|
||||
crate fn lit_to_const<'gcx, 'tcx>(
|
||||
lit: &'tcx ast::LitKind,
|
||||
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
|
||||
ty: Ty<'tcx>,
|
||||
|
@ -1630,7 +1630,7 @@ fn constructor_intersects_pattern<'p, 'a: 'p, 'tcx: 'a>(
|
||||
}
|
||||
}
|
||||
|
||||
fn constructor_covered_by_range<'a, 'tcx>(
|
||||
fn constructor_covered_by_range<'tcx>(
|
||||
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
|
||||
ctor: &Constructor<'tcx>,
|
||||
pat: &Pattern<'tcx>,
|
||||
|
@ -26,7 +26,7 @@ use std::slice;
|
||||
use syntax::ptr::P;
|
||||
use syntax_pos::{Span, DUMMY_SP, MultiSpan};
|
||||
|
||||
pub(crate) fn check_match<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) {
|
||||
pub(crate) fn check_match<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, def_id: DefId) {
|
||||
let body_id = if let Some(id) = tcx.hir().as_local_hir_id(def_id) {
|
||||
tcx.hir().body_owned_by(id)
|
||||
} else {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user