1
Fork 0

rustc: remove 'x: 'y bounds (except from comments/strings).

This commit is contained in:
Eduard-Mihai Burtescu 2019-06-14 19:39:39 +03:00
parent 44fb88d252
commit b25b466a88
154 changed files with 305 additions and 305 deletions

View file

@ -7,7 +7,7 @@ use crate::ty::{self, TyCtxt};
use crate::hir::{self, PatKind}; use crate::hir::{self, PatKind};
use crate::hir::def_id::DefId; use crate::hir::def_id::DefId;
struct CFGBuilder<'a, 'tcx: 'a> { struct CFGBuilder<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
owner_def_id: DefId, owner_def_id: DefId,
tables: &'a ty::TypeckTables<'tcx>, tables: &'a ty::TypeckTables<'tcx>,

View file

@ -11,7 +11,7 @@ use crate::ty::TyCtxt;
pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode); pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode);
pub type Edge<'a> = &'a cfg::CFGEdge; pub type Edge<'a> = &'a cfg::CFGEdge;
pub struct LabelledCFG<'a, 'tcx: 'a> { pub struct LabelledCFG<'a, 'tcx> {
pub tcx: TyCtxt<'tcx>, pub tcx: TyCtxt<'tcx>,
pub cfg: &'a cfg::CFG, pub cfg: &'a cfg::CFG,
pub name: String, pub name: String,

View file

@ -207,8 +207,8 @@ macro_rules! define_dep_nodes {
pub fn new<'a, 'tcx>(tcx: TyCtxt<'tcx>, pub fn new<'a, 'tcx>(tcx: TyCtxt<'tcx>,
dep: DepConstructor<'tcx>) dep: DepConstructor<'tcx>)
-> DepNode -> DepNode
where 'tcx: 'a, where 'tcx,
'tcx: 'a 'tcx
{ {
match dep { match dep {
$( $(

View file

@ -74,7 +74,7 @@ impl<'a> FnKind<'a> {
/// ///
/// See the comments on `ItemLikeVisitor` for more details on the overall /// See the comments on `ItemLikeVisitor` for more details on the overall
/// visit strategy. /// visit strategy.
pub enum NestedVisitorMap<'this, 'tcx: 'this> { pub enum NestedVisitorMap<'this, 'tcx> {
/// Do not visit any nested things. When you add a new /// Do not visit any nested things. When you add a new
/// "non-nested" thing, you will want to audit such uses to see if /// "non-nested" thing, you will want to audit such uses to see if
/// they remain valid. /// they remain valid.

View file

@ -415,7 +415,7 @@ impl<'a> LoweringContext<'a> {
/// needed from arbitrary locations in the crate, /// needed from arbitrary locations in the crate,
/// e.g., the number of lifetime generic parameters /// e.g., the number of lifetime generic parameters
/// declared for every type and trait definition. /// declared for every type and trait definition.
struct MiscCollector<'tcx, 'interner: 'tcx> { struct MiscCollector<'tcx, 'interner> {
lctx: &'tcx mut LoweringContext<'interner>, lctx: &'tcx mut LoweringContext<'interner>,
hir_id_owner: Option<NodeId>, hir_id_owner: Option<NodeId>,
} }
@ -561,7 +561,7 @@ impl<'a> LoweringContext<'a> {
} }
} }
struct ItemLowerer<'tcx, 'interner: 'tcx> { struct ItemLowerer<'tcx, 'interner> {
lctx: &'tcx mut LoweringContext<'interner>, lctx: &'tcx mut LoweringContext<'interner>,
} }
@ -1788,7 +1788,7 @@ impl<'a> LoweringContext<'a> {
// This visitor walks over `impl Trait` bounds and creates defs for all lifetimes that // This visitor walks over `impl Trait` bounds and creates defs for all lifetimes that
// appear in the bounds, excluding lifetimes that are created within the bounds. // appear in the bounds, excluding lifetimes that are created within the bounds.
// E.g., `'a`, `'b`, but not `'c` in `impl for<'c> SomeTrait<'a, 'b, 'c>`. // E.g., `'a`, `'b`, but not `'c` in `impl for<'c> SomeTrait<'a, 'b, 'c>`.
struct ImplTraitLifetimeCollector<'r, 'a: 'r> { struct ImplTraitLifetimeCollector<'r, 'a> {
context: &'r mut LoweringContext<'a>, context: &'r mut LoweringContext<'a>,
parent: DefIndex, parent: DefIndex,
exist_ty_id: NodeId, exist_ty_id: NodeId,
@ -1799,7 +1799,7 @@ impl<'a> LoweringContext<'a> {
output_lifetime_params: Vec<hir::GenericParam>, output_lifetime_params: Vec<hir::GenericParam>,
} }
impl<'r, 'a: 'r, 'v> hir::intravisit::Visitor<'v> for ImplTraitLifetimeCollector<'r, 'a> { impl<'r, 'a, 'v> hir::intravisit::Visitor<'v> for ImplTraitLifetimeCollector<'r, 'a> {
fn nested_visit_map<'this>( fn nested_visit_map<'this>(
&'this mut self, &'this mut self,
) -> hir::intravisit::NestedVisitorMap<'this, 'v> { ) -> hir::intravisit::NestedVisitorMap<'this, 'v> {

View file

@ -26,19 +26,19 @@ pub fn check_crate<'hir>(hir_map: &hir::map::Map<'hir>) {
} }
} }
struct HirIdValidator<'a, 'hir: 'a> { struct HirIdValidator<'a, 'hir> {
hir_map: &'a hir::map::Map<'hir>, hir_map: &'a hir::map::Map<'hir>,
owner_def_index: Option<DefIndex>, owner_def_index: Option<DefIndex>,
hir_ids_seen: FxHashSet<ItemLocalId>, hir_ids_seen: FxHashSet<ItemLocalId>,
errors: &'a Lock<Vec<String>>, errors: &'a Lock<Vec<String>>,
} }
struct OuterVisitor<'a, 'hir: 'a> { struct OuterVisitor<'a, 'hir> {
hir_map: &'a hir::map::Map<'hir>, hir_map: &'a hir::map::Map<'hir>,
errors: &'a Lock<Vec<String>>, errors: &'a Lock<Vec<String>>,
} }
impl<'a, 'hir: 'a> OuterVisitor<'a, 'hir> { impl<'a, 'hir> OuterVisitor<'a, 'hir> {
fn new_inner_visitor(&self, fn new_inner_visitor(&self,
hir_map: &'a hir::map::Map<'hir>) hir_map: &'a hir::map::Map<'hir>)
-> HirIdValidator<'a, 'hir> { -> HirIdValidator<'a, 'hir> {
@ -51,7 +51,7 @@ impl<'a, 'hir: 'a> OuterVisitor<'a, 'hir> {
} }
} }
impl<'a, 'hir: 'a> ItemLikeVisitor<'hir> for OuterVisitor<'a, 'hir> { impl<'a, 'hir> ItemLikeVisitor<'hir> for OuterVisitor<'a, 'hir> {
fn visit_item(&mut self, i: &'hir hir::Item) { fn visit_item(&mut self, i: &'hir hir::Item) {
let mut inner_visitor = self.new_inner_visitor(self.hir_map); let mut inner_visitor = self.new_inner_visitor(self.hir_map);
inner_visitor.check(i.hir_id, |this| intravisit::walk_item(this, i)); inner_visitor.check(i.hir_id, |this| intravisit::walk_item(this, i));
@ -68,7 +68,7 @@ impl<'a, 'hir: 'a> ItemLikeVisitor<'hir> for OuterVisitor<'a, 'hir> {
} }
} }
impl<'a, 'hir: 'a> HirIdValidator<'a, 'hir> { impl<'a, 'hir> HirIdValidator<'a, 'hir> {
#[cold] #[cold]
#[inline(never)] #[inline(never)]
fn error(&self, f: impl FnOnce() -> String) { fn error(&self, f: impl FnOnce() -> String) {
@ -133,7 +133,7 @@ impl<'a, 'hir: 'a> HirIdValidator<'a, 'hir> {
} }
} }
impl<'a, 'hir: 'a> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> { impl<'a, 'hir> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
fn nested_visit_map<'this>(&'this mut self) fn nested_visit_map<'this>(&'this mut self)
-> intravisit::NestedVisitorMap<'this, 'hir> { -> intravisit::NestedVisitorMap<'this, 'hir> {

View file

@ -30,13 +30,13 @@ use super::*;
use crate::ty::Const; use crate::ty::Const;
use crate::ty::relate::{Relate, TypeRelation}; use crate::ty::relate::{Relate, TypeRelation};
pub struct At<'a, 'tcx: 'a> { pub struct At<'a, 'tcx> {
pub infcx: &'a InferCtxt<'a, 'tcx>, pub infcx: &'a InferCtxt<'a, 'tcx>,
pub cause: &'a ObligationCause<'tcx>, pub cause: &'a ObligationCause<'tcx>,
pub param_env: ty::ParamEnv<'tcx>, pub param_env: ty::ParamEnv<'tcx>,
} }
pub struct Trace<'a, 'tcx: 'a> { pub struct Trace<'a, 'tcx> {
at: At<'a, 'tcx>, at: At<'a, 'tcx>,
a_is_expected: bool, a_is_expected: bool,
trace: TypeTrace<'tcx>, trace: TypeTrace<'tcx>,

View file

@ -275,7 +275,7 @@ impl CanonicalizeRegionMode for CanonicalizeFreeRegionsOtherThanStatic {
} }
} }
struct Canonicalizer<'cx, 'tcx: 'cx> { struct Canonicalizer<'cx, 'tcx> {
infcx: Option<&'cx InferCtxt<'cx, 'tcx>>, infcx: Option<&'cx InferCtxt<'cx, 'tcx>>,
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
variables: SmallVec<[CanonicalVarInfo; 8]>, variables: SmallVec<[CanonicalVarInfo; 8]>,

View file

@ -44,7 +44,7 @@ use syntax::ast;
use syntax_pos::{Span, DUMMY_SP}; use syntax_pos::{Span, DUMMY_SP};
#[derive(Clone)] #[derive(Clone)]
pub struct CombineFields<'infcx, 'tcx: 'infcx> { pub struct CombineFields<'infcx, 'tcx> {
pub infcx: &'infcx InferCtxt<'infcx, 'tcx>, pub infcx: &'infcx InferCtxt<'infcx, 'tcx>,
pub trace: TypeTrace<'tcx>, pub trace: TypeTrace<'tcx>,
pub cause: Option<ty::relate::Cause>, pub cause: Option<ty::relate::Cause>,
@ -355,7 +355,7 @@ impl<'infcx, 'tcx> CombineFields<'infcx, 'tcx> {
} }
} }
struct Generalizer<'cx, 'tcx: 'cx> { struct Generalizer<'cx, 'tcx> {
infcx: &'cx InferCtxt<'cx, 'tcx>, infcx: &'cx InferCtxt<'cx, 'tcx>,
/// The span, used when creating new type variables and things. /// The span, used when creating new type variables and things.

View file

@ -11,7 +11,7 @@ use crate::mir::interpret::ConstValue;
use crate::infer::unify_key::replace_if_possible; use crate::infer::unify_key::replace_if_possible;
/// Ensures `a` is made equal to `b`. Returns `a` on success. /// Ensures `a` is made equal to `b`. Returns `a` on success.
pub struct Equate<'combine, 'infcx: 'combine, 'tcx: 'infcx> { pub struct Equate<'combine, 'infcx, 'tcx> {
fields: &'combine mut CombineFields<'infcx, 'tcx>, fields: &'combine mut CombineFields<'infcx, 'tcx>,
a_is_expected: bool, a_is_expected: bool,
} }

View file

@ -30,7 +30,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
} }
} }
pub struct NiceRegionError<'cx, 'tcx: 'cx> { pub struct NiceRegionError<'cx, 'tcx> {
infcx: &'cx InferCtxt<'cx, 'tcx>, infcx: &'cx InferCtxt<'cx, 'tcx>,
error: Option<RegionResolutionError<'tcx>>, error: Option<RegionResolutionError<'tcx>>,
regions: Option<(Span, ty::Region<'tcx>, ty::Region<'tcx>)>, regions: Option<(Span, ty::Region<'tcx>, ty::Region<'tcx>)>,

View file

@ -41,7 +41,7 @@ use std::collections::hash_map::Entry;
use super::InferCtxt; use super::InferCtxt;
use super::unify_key::ToType; use super::unify_key::ToType;
pub struct TypeFreshener<'a, 'tcx: 'a> { pub struct TypeFreshener<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
ty_freshen_count: u32, ty_freshen_count: u32,
const_freshen_count: u32, const_freshen_count: u32,

View file

@ -133,7 +133,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
} }
} }
pub struct InferenceFudger<'a, 'tcx: 'a> { pub struct InferenceFudger<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
type_vars: (Range<TyVid>, Vec<TypeVariableOrigin>), type_vars: (Range<TyVid>, Vec<TypeVariableOrigin>),
int_vars: Range<IntVid>, int_vars: Range<IntVid>,

View file

@ -8,7 +8,7 @@ use crate::ty::{self, Ty, TyCtxt};
use crate::ty::relate::{Relate, RelateResult, TypeRelation}; use crate::ty::relate::{Relate, RelateResult, TypeRelation};
/// "Greatest lower bound" (common subtype) /// "Greatest lower bound" (common subtype)
pub struct Glb<'combine, 'infcx: 'combine, 'tcx: 'infcx> { pub struct Glb<'combine, 'infcx, 'tcx> {
fields: &'combine mut CombineFields<'infcx, 'tcx>, fields: &'combine mut CombineFields<'infcx, 'tcx>,
a_is_expected: bool, a_is_expected: bool,
} }

View file

@ -27,7 +27,7 @@ use crate::ty::TyVar;
use crate::ty::{self, Ty}; use crate::ty::{self, Ty};
use crate::ty::relate::{RelateResult, TypeRelation}; use crate::ty::relate::{RelateResult, TypeRelation};
pub trait LatticeDir<'f, 'tcx: 'f>: TypeRelation<'tcx> { pub trait LatticeDir<'f, 'tcx>: TypeRelation<'tcx> {
fn infcx(&self) -> &'f InferCtxt<'f, 'tcx>; fn infcx(&self) -> &'f InferCtxt<'f, 'tcx>;
fn cause(&self) -> &ObligationCause<'tcx>; fn cause(&self) -> &ObligationCause<'tcx>;
@ -48,7 +48,7 @@ pub fn super_lattice_tys<'a, 'tcx, L>(
) -> RelateResult<'tcx, Ty<'tcx>> ) -> RelateResult<'tcx, Ty<'tcx>>
where where
L: LatticeDir<'a, 'tcx>, L: LatticeDir<'a, 'tcx>,
'tcx: 'a, 'tcx,
{ {
debug!("{}.lattice_tys({:?}, {:?})", debug!("{}.lattice_tys({:?}, {:?})",
this.tag(), this.tag(),

View file

@ -107,7 +107,7 @@ pub fn maybe_print_constraints_for<'a, 'tcx>(
} }
} }
struct ConstraintGraph<'a, 'tcx: 'a> { struct ConstraintGraph<'a, 'tcx> {
graph_name: String, graph_name: String,
region_rels: &'a RegionRelations<'a, 'tcx>, region_rels: &'a RegionRelations<'a, 'tcx>,
map: &'a BTreeMap<Constraint<'tcx>, SubregionOrigin<'tcx>>, map: &'a BTreeMap<Constraint<'tcx>, SubregionOrigin<'tcx>>,

View file

@ -93,7 +93,7 @@ struct RegionAndOrigin<'tcx> {
type RegionGraph<'tcx> = Graph<(), Constraint<'tcx>>; type RegionGraph<'tcx> = Graph<(), Constraint<'tcx>>;
struct LexicalResolver<'cx, 'tcx: 'cx> { struct LexicalResolver<'cx, 'tcx> {
region_rels: &'cx RegionRelations<'cx, 'tcx>, region_rels: &'cx RegionRelations<'cx, 'tcx>,
var_infos: VarInfos, var_infos: VarInfos,
data: RegionConstraintData<'tcx>, data: RegionConstraintData<'tcx>,

View file

@ -8,7 +8,7 @@ use crate::ty::{self, Ty, TyCtxt};
use crate::ty::relate::{Relate, RelateResult, TypeRelation}; use crate::ty::relate::{Relate, RelateResult, TypeRelation};
/// "Least upper bound" (common supertype) /// "Least upper bound" (common supertype)
pub struct Lub<'combine, 'infcx: 'combine, 'tcx: 'infcx> { pub struct Lub<'combine, 'infcx, 'tcx> {
fields: &'combine mut CombineFields<'infcx, 'tcx>, fields: &'combine mut CombineFields<'infcx, 'tcx>,
a_is_expected: bool, a_is_expected: bool,
} }

View file

@ -585,7 +585,7 @@ impl<'tcx> InferOk<'tcx, ()> {
} }
#[must_use = "once you start a snapshot, you should always consume it"] #[must_use = "once you start a snapshot, you should always consume it"]
pub struct CombinedSnapshot<'a, 'tcx: 'a> { pub struct CombinedSnapshot<'a, 'tcx> {
projection_cache_snapshot: traits::ProjectionCacheSnapshot, projection_cache_snapshot: traits::ProjectionCacheSnapshot,
type_snapshot: type_variable::Snapshot<'tcx>, type_snapshot: type_variable::Snapshot<'tcx>,
const_snapshot: ut::Snapshot<ut::InPlace<ty::ConstVid<'tcx>>>, const_snapshot: ut::Snapshot<ut::InPlace<ty::ConstVid<'tcx>>>,

View file

@ -38,7 +38,7 @@ pub enum NormalizationStrategy {
Eager, Eager,
} }
pub struct TypeRelating<'me, 'tcx: 'me, D> pub struct TypeRelating<'me, 'tcx, D>
where where
D: TypeRelatingDelegate<'tcx>, D: TypeRelatingDelegate<'tcx>,
{ {
@ -741,7 +741,7 @@ where
/// binder depth, and finds late-bound regions targeting the /// binder depth, and finds late-bound regions targeting the
/// `for<..`>. For each of those, it creates an entry in /// `for<..`>. For each of those, it creates an entry in
/// `bound_region_scope`. /// `bound_region_scope`.
struct ScopeInstantiator<'me, 'tcx: 'me> { struct ScopeInstantiator<'me, 'tcx> {
next_region: &'me mut dyn FnMut(ty::BoundRegion) -> ty::Region<'tcx>, next_region: &'me mut dyn FnMut(ty::BoundRegion) -> ty::Region<'tcx>,
// The debruijn index of the scope we are instantiating. // The debruijn index of the scope we are instantiating.
target_index: ty::DebruijnIndex, target_index: ty::DebruijnIndex,
@ -798,7 +798,7 @@ impl<'me, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx> {
/// scopes. /// scopes.
/// ///
/// [blog post]: https://is.gd/0hKvIr /// [blog post]: https://is.gd/0hKvIr
struct TypeGeneralizer<'me, 'tcx: 'me, D> struct TypeGeneralizer<'me, 'tcx, D>
where where
D: TypeRelatingDelegate<'tcx> + 'me, D: TypeRelatingDelegate<'tcx> + 'me,
{ {

View file

@ -723,7 +723,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
} }
} }
struct Instantiator<'a, 'tcx: 'a> { struct Instantiator<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
parent_def_id: DefId, parent_def_id: DefId,
body_id: hir::HirId, body_id: hir::HirId,

View file

@ -67,7 +67,7 @@ pub struct OutlivesEnvironment<'tcx> {
/// because of implied bounds. /// because of implied bounds.
pub type RegionBoundPairs<'tcx> = Vec<(ty::Region<'tcx>, GenericKind<'tcx>)>; pub type RegionBoundPairs<'tcx> = Vec<(ty::Region<'tcx>, GenericKind<'tcx>)>;
impl<'a, 'tcx: 'a> OutlivesEnvironment<'tcx> { impl<'a, 'tcx> OutlivesEnvironment<'tcx> {
pub fn new(param_env: ty::ParamEnv<'tcx>) -> Self { pub fn new(param_env: ty::ParamEnv<'tcx>) -> Self {
let mut env = OutlivesEnvironment { let mut env = OutlivesEnvironment {
param_env, param_env,

View file

@ -226,7 +226,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
/// via a "delegate" of type `D` -- this is usually the `infcx`, which /// via a "delegate" of type `D` -- this is usually the `infcx`, which
/// accrues them into the `region_obligations` code, but for NLL we /// accrues them into the `region_obligations` code, but for NLL we
/// use something else. /// use something else.
pub struct TypeOutlives<'cx, 'tcx: 'cx, D> pub struct TypeOutlives<'cx, 'tcx, D>
where where
D: TypeOutlivesDelegate<'tcx>, D: TypeOutlivesDelegate<'tcx>,
{ {

View file

@ -12,7 +12,7 @@ use crate::util::captures::Captures;
/// via a "delegate" of type `D` -- this is usually the `infcx`, which /// via a "delegate" of type `D` -- this is usually the `infcx`, which
/// accrues them into the `region_obligations` code, but for NLL we /// accrues them into the `region_obligations` code, but for NLL we
/// use something else. /// use something else.
pub struct VerifyBoundCx<'cx, 'tcx: 'cx> { pub struct VerifyBoundCx<'cx, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
region_bound_pairs: &'cx RegionBoundPairs<'tcx>, region_bound_pairs: &'cx RegionBoundPairs<'tcx>,
implicit_region_bound: Option<ty::Region<'tcx>>, implicit_region_bound: Option<ty::Region<'tcx>>,

View file

@ -12,7 +12,7 @@ use crate::ty::fold::{TypeFolder, TypeVisitor};
/// been unified with (similar to `shallow_resolve`, but deep). This is /// been unified with (similar to `shallow_resolve`, but deep). This is
/// useful for printing messages etc but also required at various /// useful for printing messages etc but also required at various
/// points for correctness. /// points for correctness.
pub struct OpportunisticVarResolver<'a, 'tcx: 'a> { pub struct OpportunisticVarResolver<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
} }
@ -50,7 +50,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for OpportunisticVarResolver<'a, 'tcx> {
/// The opportunistic type and region resolver is similar to the /// The opportunistic type and region resolver is similar to the
/// opportunistic type resolver, but also opportunistically resolves /// opportunistic type resolver, but also opportunistically resolves
/// regions. It is useful for canonicalization. /// regions. It is useful for canonicalization.
pub struct OpportunisticTypeAndRegionResolver<'a, 'tcx: 'a> { pub struct OpportunisticTypeAndRegionResolver<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
} }
@ -101,7 +101,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for OpportunisticTypeAndRegionResolver<'a, 'tcx>
/// type variables that don't yet have a value. The first unresolved type is stored. /// type variables that don't yet have a value. The first unresolved type is stored.
/// It does not construct the fully resolved type (which might /// It does not construct the fully resolved type (which might
/// involve some hashing and so forth). /// involve some hashing and so forth).
pub struct UnresolvedTypeFinder<'a, 'tcx: 'a> { pub struct UnresolvedTypeFinder<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
/// Used to find the type parameter name and location for error reporting. /// Used to find the type parameter name and location for error reporting.
@ -171,7 +171,7 @@ where
// N.B. This type is not public because the protocol around checking the // N.B. This type is not public because the protocol around checking the
// `err` field is not enforcable otherwise. // `err` field is not enforcable otherwise.
struct FullTypeResolver<'a, 'tcx: 'a> { struct FullTypeResolver<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
err: Option<FixupError<'tcx>>, err: Option<FixupError<'tcx>>,
} }

View file

@ -11,7 +11,7 @@ use crate::mir::interpret::ConstValue;
use std::mem; use std::mem;
/// Ensures `a` is made a subtype of `b`. Returns `a` on success. /// Ensures `a` is made a subtype of `b`. Returns `a` on success.
pub struct Sub<'combine, 'infcx: 'combine, 'tcx: 'infcx> { pub struct Sub<'combine, 'infcx, 'tcx> {
fields: &'combine mut CombineFields<'infcx, 'tcx>, fields: &'combine mut CombineFields<'infcx, 'tcx>,
a_is_expected: bool, a_is_expected: bool,
} }

View file

@ -507,7 +507,7 @@ impl LintStore {
} }
/// Context for lint checking after type checking. /// Context for lint checking after type checking.
pub struct LateContext<'a, 'tcx: 'a> { pub struct LateContext<'a, 'tcx> {
/// Type context we're checking in. /// Type context we're checking in.
pub tcx: TyCtxt<'tcx>, pub tcx: TyCtxt<'tcx>,
@ -533,7 +533,7 @@ pub struct LateContext<'a, 'tcx: 'a> {
only_module: bool, only_module: bool,
} }
pub struct LateContextAndPass<'a, 'tcx: 'a, T: LateLintPass<'a, 'tcx>> { pub struct LateContextAndPass<'a, 'tcx, T: LateLintPass<'a, 'tcx>> {
context: LateContext<'a, 'tcx>, context: LateContext<'a, 'tcx>,
pass: T, pass: T,
} }

View file

@ -38,7 +38,7 @@ fn should_explore<'tcx>(tcx: TyCtxt<'tcx>, hir_id: hir::HirId) -> bool {
} }
} }
struct MarkSymbolVisitor<'a, 'tcx: 'a> { struct MarkSymbolVisitor<'a, 'tcx> {
worklist: Vec<hir::HirId>, worklist: Vec<hir::HirId>,
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
tables: &'a ty::TypeckTables<'tcx>, tables: &'a ty::TypeckTables<'tcx>,
@ -351,7 +351,7 @@ fn has_allow_dead_code_or_lang_attr(
// or // or
// 2) We are not sure to be live or not // 2) We are not sure to be live or not
// * Implementation of a trait method // * Implementation of a trait method
struct LifeSeeder<'k, 'tcx: 'k> { struct LifeSeeder<'k, 'tcx> {
worklist: Vec<hir::HirId>, worklist: Vec<hir::HirId>,
krate: &'k hir::Crate, krate: &'k hir::Crate,
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,

View file

@ -11,7 +11,7 @@ use crate::hir::itemlikevisit::ItemLikeVisitor;
use crate::ty::TyCtxt; use crate::ty::TyCtxt;
use crate::ty::query::Providers; use crate::ty::query::Providers;
struct EntryContext<'a, 'tcx: 'a> { struct EntryContext<'a, 'tcx> {
session: &'a Session, session: &'a Session,
map: &'a hir_map::Map<'tcx>, map: &'a hir_map::Map<'tcx>,

View file

@ -229,7 +229,7 @@ impl OverloadedCallType {
// The ExprUseVisitor type // The ExprUseVisitor type
// //
// This is the code that actually walks the tree. // This is the code that actually walks the tree.
pub struct ExprUseVisitor<'a, 'tcx: 'a> { pub struct ExprUseVisitor<'a, 'tcx> {
mc: mc::MemCategorizationContext<'a, 'tcx>, mc: mc::MemCategorizationContext<'a, 'tcx>,
delegate: &'a mut dyn Delegate<'tcx>, delegate: &'a mut dyn Delegate<'tcx>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,

View file

@ -15,7 +15,7 @@ use crate::ty::{self, TyCtxt, Region};
/// ///
/// This stuff is a bit convoluted and should be refactored, but as we /// This stuff is a bit convoluted and should be refactored, but as we
/// transition to NLL, it'll all go away anyhow. /// transition to NLL, it'll all go away anyhow.
pub struct RegionRelations<'a, 'tcx: 'a> { pub struct RegionRelations<'a, 'tcx> {
pub tcx: TyCtxt<'tcx>, pub tcx: TyCtxt<'tcx>,
/// The context used to fetch the region maps. /// The context used to fetch the region maps.

View file

@ -352,7 +352,7 @@ impl IrMaps<'tcx> {
} }
} }
fn visit_fn<'a, 'tcx: 'a>( fn visit_fn<'a, 'tcx>(
ir: &mut IrMaps<'tcx>, ir: &mut IrMaps<'tcx>,
fk: FnKind<'tcx>, fk: FnKind<'tcx>,
decl: &'tcx hir::FnDecl, decl: &'tcx hir::FnDecl,
@ -682,7 +682,7 @@ const ACC_READ: u32 = 1;
const ACC_WRITE: u32 = 2; const ACC_WRITE: u32 = 2;
const ACC_USE: u32 = 4; const ACC_USE: u32 = 4;
struct Liveness<'a, 'tcx: 'a> { struct Liveness<'a, 'tcx> {
ir: &'a mut IrMaps<'tcx>, ir: &'a mut IrMaps<'tcx>,
tables: &'a ty::TypeckTables<'tcx>, tables: &'a ty::TypeckTables<'tcx>,
s: Specials, s: Specials,

View file

@ -65,7 +65,7 @@ fn method_might_be_inlined<'tcx>(
} }
// Information needed while computing reachability. // Information needed while computing reachability.
struct ReachableContext<'a, 'tcx: 'a> { struct ReachableContext<'a, 'tcx> {
// The type context. // The type context.
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
tables: &'a ty::TypeckTables<'tcx>, tables: &'a ty::TypeckTables<'tcx>,
@ -334,13 +334,13 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
// items of non-exported traits (or maybe all local traits?) unless their respective // items of non-exported traits (or maybe all local traits?) unless their respective
// trait items are used from inlinable code through method call syntax or UFCS, or their // trait items are used from inlinable code through method call syntax or UFCS, or their
// trait is a lang item. // trait is a lang item.
struct CollectPrivateImplItemsVisitor<'a, 'tcx: 'a> { struct CollectPrivateImplItemsVisitor<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
access_levels: &'a privacy::AccessLevels, access_levels: &'a privacy::AccessLevels,
worklist: &'a mut Vec<hir::HirId>, worklist: &'a mut Vec<hir::HirId>,
} }
impl<'a, 'tcx: 'a> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a, 'tcx> { impl<'a, 'tcx> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a, 'tcx> {
fn visit_item(&mut self, item: &hir::Item) { fn visit_item(&mut self, item: &hir::Item) {
// Anything which has custom linkage gets thrown on the worklist no // Anything which has custom linkage gets thrown on the worklist no
// matter where it is in the crate, along with "special std symbols" // matter where it is in the crate, along with "special std symbols"

View file

@ -217,7 +217,7 @@ impl_stable_hash_for!(struct crate::middle::resolve_lifetime::ResolveLifetimes {
object_lifetime_defaults object_lifetime_defaults
}); });
struct LifetimeContext<'a, 'tcx: 'a> { struct LifetimeContext<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
map: &'a mut NamedRegionMap, map: &'a mut NamedRegionMap,
scope: ScopeRef<'a>, scope: ScopeRef<'a>,
@ -1160,7 +1160,7 @@ fn signal_shadowing_problem(tcx: TyCtxt<'_>, name: ast::Name, orig: Original, sh
// Adds all labels in `b` to `ctxt.labels_in_fn`, signalling a warning // Adds all labels in `b` to `ctxt.labels_in_fn`, signalling a warning
// if one of the label shadows a lifetime or another label. // if one of the label shadows a lifetime or another label.
fn extract_labels(ctxt: &mut LifetimeContext<'_, '_>, body: &hir::Body) { fn extract_labels(ctxt: &mut LifetimeContext<'_, '_>, body: &hir::Body) {
struct GatherLabels<'a, 'tcx: 'a> { struct GatherLabels<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
scope: ScopeRef<'a>, scope: ScopeRef<'a>,
labels_in_fn: &'a mut Vec<ast::Ident>, labels_in_fn: &'a mut Vec<ast::Ident>,

View file

@ -105,7 +105,7 @@ impl_stable_hash_for!(struct self::Index<'tcx> {
}); });
// A private tree-walker for producing an Index. // A private tree-walker for producing an Index.
struct Annotator<'a, 'tcx: 'a> { struct Annotator<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
index: &'a mut Index<'tcx>, index: &'a mut Index<'tcx>,
parent_stab: Option<&'tcx Stability>, parent_stab: Option<&'tcx Stability>,
@ -113,7 +113,7 @@ struct Annotator<'a, 'tcx: 'a> {
in_trait_impl: bool, in_trait_impl: bool,
} }
impl<'a, 'tcx: 'a> Annotator<'a, 'tcx> { impl<'a, 'tcx> Annotator<'a, 'tcx> {
// Determine the stability for a node based on its attributes and inherited // Determine the stability for a node based on its attributes and inherited
// stability. The stability is recorded in the index and used as the parent. // stability. The stability is recorded in the index and used as the parent.
fn annotate<F>(&mut self, hir_id: HirId, attrs: &[Attribute], fn annotate<F>(&mut self, hir_id: HirId, attrs: &[Attribute],
@ -316,12 +316,12 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
} }
} }
struct MissingStabilityAnnotations<'a, 'tcx: 'a> { struct MissingStabilityAnnotations<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
access_levels: &'a AccessLevels, access_levels: &'a AccessLevels,
} }
impl<'a, 'tcx: 'a> MissingStabilityAnnotations<'a, 'tcx> { impl<'a, 'tcx> MissingStabilityAnnotations<'a, 'tcx> {
fn check_missing_stability(&self, hir_id: HirId, span: Span, name: &str) { fn check_missing_stability(&self, hir_id: HirId, span: Span, name: &str) {
let stab = self.tcx.stability().local_stability(hir_id); let stab = self.tcx.stability().local_stability(hir_id);
let is_error = !self.tcx.sess.opts.test && let is_error = !self.tcx.sess.opts.test &&

View file

@ -17,7 +17,7 @@ use crate::ty::TyCtxt;
macro_rules! weak_lang_items { macro_rules! weak_lang_items {
($($name:ident, $item:ident, $sym:ident;)*) => ( ($($name:ident, $item:ident, $sym:ident;)*) => (
struct Context<'a, 'tcx: 'a> { struct Context<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
items: &'a mut lang_items::LanguageItems, items: &'a mut lang_items::LanguageItems,
} }

View file

@ -2104,7 +2104,7 @@ impl<'tcx> Place<'tcx> {
/// N.B., this particular impl strategy is not the most obvious. It was /// N.B., this particular impl strategy is not the most obvious. It was
/// chosen because it makes a measurable difference to NLL /// chosen because it makes a measurable difference to NLL
/// performance, as this code (`borrow_conflicts_with_place`) is somewhat hot. /// performance, as this code (`borrow_conflicts_with_place`) is somewhat hot.
pub enum Projections<'p, 'tcx: 'p> { pub enum Projections<'p, 'tcx> {
Empty, Empty,
List { List {
@ -2143,7 +2143,7 @@ impl<'p, 'tcx> IntoIterator for &'p Projections<'p, 'tcx> {
/// N.B., this is not a *true* Rust iterator -- the code above just /// N.B., this is not a *true* Rust iterator -- the code above just
/// manually invokes `next`. This is because we (sometimes) want to /// manually invokes `next`. This is because we (sometimes) want to
/// keep executing even after `None` has been returned. /// keep executing even after `None` has been returned.
pub struct ProjectionsIter<'p, 'tcx: 'p> { pub struct ProjectionsIter<'p, 'tcx> {
pub value: &'p Projections<'p, 'tcx>, pub value: &'p Projections<'p, 'tcx>,
} }

View file

@ -20,7 +20,7 @@ use super::*;
/// ///
/// A preorder traversal of this graph is either `A B D C` or `A C D B` /// A preorder traversal of this graph is either `A B D C` or `A C D B`
#[derive(Clone)] #[derive(Clone)]
pub struct Preorder<'a, 'tcx: 'a> { pub struct Preorder<'a, 'tcx> {
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
visited: BitSet<BasicBlock>, visited: BitSet<BasicBlock>,
worklist: Vec<BasicBlock>, worklist: Vec<BasicBlock>,
@ -98,7 +98,7 @@ impl<'a, 'tcx> Iterator for Preorder<'a, 'tcx> {
/// ``` /// ```
/// ///
/// A Postorder traversal of this graph is `D B C A` or `D C B A` /// A Postorder traversal of this graph is `D B C A` or `D C B A`
pub struct Postorder<'a, 'tcx: 'a> { pub struct Postorder<'a, 'tcx> {
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
visited: BitSet<BasicBlock>, visited: BitSet<BasicBlock>,
visit_stack: Vec<(BasicBlock, Successors<'a>)>, visit_stack: Vec<(BasicBlock, Successors<'a>)>,
@ -251,7 +251,7 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> {
/// constructed as few times as possible. Use the `reset` method to be able /// constructed as few times as possible. Use the `reset` method to be able
/// to re-use the traversal /// to re-use the traversal
#[derive(Clone)] #[derive(Clone)]
pub struct ReversePostorder<'a, 'tcx: 'a> { pub struct ReversePostorder<'a, 'tcx> {
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
blocks: Vec<BasicBlock>, blocks: Vec<BasicBlock>,
idx: usize idx: usize

View file

@ -1449,7 +1449,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
pred: ty::PolyTraitRef<'tcx>, pred: ty::PolyTraitRef<'tcx>,
) -> bool { ) -> bool {
struct ParamToVarFolder<'a, 'tcx: 'a> { struct ParamToVarFolder<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
var_map: FxHashMap<Ty<'tcx>, Ty<'tcx>>, var_map: FxHashMap<Ty<'tcx>, Ty<'tcx>>,
} }

View file

@ -224,7 +224,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> {
} }
} }
struct FulfillProcessor<'a, 'b: 'a, 'tcx: 'b> { struct FulfillProcessor<'a, 'b, 'tcx> {
selcx: &'a mut SelectionContext<'b, 'tcx>, selcx: &'a mut SelectionContext<'b, 'tcx>,
register_region_obligations: bool, register_region_obligations: bool,
} }

View file

@ -285,7 +285,7 @@ where
} }
} }
struct AssocTypeNormalizer<'a, 'b: 'a, 'tcx: 'b> { struct AssocTypeNormalizer<'a, 'b, 'tcx> {
selcx: &'a mut SelectionContext<'b, 'tcx>, selcx: &'a mut SelectionContext<'b, 'tcx>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
cause: ObligationCause<'tcx>, cause: ObligationCause<'tcx>,

View file

@ -73,7 +73,7 @@ pub struct NormalizationResult<'tcx> {
pub normalized_ty: Ty<'tcx>, pub normalized_ty: Ty<'tcx>,
} }
struct QueryNormalizer<'cx, 'tcx: 'cx> { struct QueryNormalizer<'cx, 'tcx> {
infcx: &'cx InferCtxt<'cx, 'tcx>, infcx: &'cx InferCtxt<'cx, 'tcx>,
cause: &'cx ObligationCause<'tcx>, cause: &'cx ObligationCause<'tcx>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,

View file

@ -50,7 +50,7 @@ use std::iter;
use std::rc::Rc; use std::rc::Rc;
use crate::util::nodemap::{FxHashMap, FxHashSet}; use crate::util::nodemap::{FxHashMap, FxHashSet};
pub struct SelectionContext<'cx, 'tcx: 'cx> { pub struct SelectionContext<'cx, 'tcx> {
infcx: &'cx InferCtxt<'cx, 'tcx>, infcx: &'cx InferCtxt<'cx, 'tcx>,
/// Freshener used specifically for entries on the obligation /// Freshener used specifically for entries on the obligation
@ -144,7 +144,7 @@ impl IntercrateAmbiguityCause {
} }
// A stack that walks back up the stack frame. // A stack that walks back up the stack frame.
struct TraitObligationStack<'prev, 'tcx: 'prev> { struct TraitObligationStack<'prev, 'tcx> {
obligation: &'prev TraitObligation<'tcx>, obligation: &'prev TraitObligation<'tcx>,
/// Trait ref from `obligation` but "freshened" with the /// Trait ref from `obligation` but "freshened" with the
@ -697,7 +697,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
) -> Result<EvaluationResult, OverflowError> ) -> Result<EvaluationResult, OverflowError>
where where
I: IntoIterator<Item = PredicateObligation<'tcx>>, I: IntoIterator<Item = PredicateObligation<'tcx>>,
'tcx: 'a, 'tcx,
{ {
let mut result = EvaluatedToOk; let mut result = EvaluatedToOk;
for obligation in predicates { for obligation in predicates {
@ -3789,7 +3789,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
matcher.relate(previous, current).is_ok() matcher.relate(previous, current).is_ok()
} }
fn push_stack<'o, 's: 'o>( fn push_stack<'o, 's>(
&mut self, &mut self,
previous_stack: TraitObligationStackList<'s, 'tcx>, previous_stack: TraitObligationStackList<'s, 'tcx>,
obligation: &'o TraitObligation<'tcx>, obligation: &'o TraitObligation<'tcx>,
@ -4252,7 +4252,7 @@ impl<'tcx> ProvisionalEvaluationCache<'tcx> {
} }
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
struct TraitObligationStackList<'o, 'tcx: 'o> { struct TraitObligationStackList<'o, 'tcx> {
cache: &'o ProvisionalEvaluationCache<'tcx>, cache: &'o ProvisionalEvaluationCache<'tcx>,
head: Option<&'o TraitObligationStack<'o, 'tcx>>, head: Option<&'o TraitObligationStack<'o, 'tcx>>,
} }

View file

@ -511,7 +511,7 @@ fn decode_tagged<'a, 'tcx, D, T, V>(decoder: &mut D,
where T: Decodable + Eq + ::std::fmt::Debug, where T: Decodable + Eq + ::std::fmt::Debug,
V: Decodable, V: Decodable,
D: DecoderWithPosition, D: DecoderWithPosition,
'tcx: 'a, 'tcx,
{ {
let start_pos = decoder.position(); let start_pos = decoder.position();

View file

@ -89,7 +89,7 @@ macro_rules! profq_query_msg {
/// A type representing the responsibility to execute the job in the `job` field. /// A type representing the responsibility to execute the job in the `job` field.
/// This will poison the relevant query if dropped. /// This will poison the relevant query if dropped.
pub(super) struct JobOwner<'a, 'tcx: 'a, Q: QueryDescription<'tcx> + 'a> { pub(super) struct JobOwner<'a, 'tcx, Q: QueryDescription<'tcx> + 'a> {
cache: &'a Lock<QueryCache<'tcx, Q>>, cache: &'a Lock<QueryCache<'tcx, Q>>,
key: Q::Key, key: Q::Key,
job: Lrc<QueryJob<'tcx>>, job: Lrc<QueryJob<'tcx>>,
@ -230,7 +230,7 @@ pub struct CycleError<'tcx> {
} }
/// The result of `try_get_lock` /// The result of `try_get_lock`
pub(super) enum TryGetJob<'a, 'tcx: 'a, D: QueryDescription<'tcx> + 'a> { pub(super) enum TryGetJob<'a, 'tcx, D: QueryDescription<'tcx> + 'a> {
/// The query is not yet started. Contains a guard to the cache eventually used to start it. /// The query is not yet started. Contains a guard to the cache eventually used to start it.
NotYetStarted(JobOwner<'a, 'tcx, D>), NotYetStarted(JobOwner<'a, 'tcx, D>),

View file

@ -101,7 +101,7 @@ pub fn predicate_obligations<'a, 'tcx>(
wf.normalize() wf.normalize()
} }
struct WfPredicates<'a, 'tcx: 'a> { struct WfPredicates<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
body_id: hir::HirId, body_id: hir::HirId,

View file

@ -78,7 +78,7 @@ fn owned_ptr_base_path_rc<'tcx>(loan_path: &Rc<LoanPath<'tcx>>) -> Rc<LoanPath<'
} }
} }
struct CheckLoanCtxt<'a, 'tcx: 'a> { struct CheckLoanCtxt<'a, 'tcx> {
bccx: &'a BorrowckCtxt<'a, 'tcx>, bccx: &'a BorrowckCtxt<'a, 'tcx>,
dfcx_loans: &'a LoanDataFlow<'tcx>, dfcx_loans: &'a LoanDataFlow<'tcx>,
move_data: &'a move_data::FlowedMoveData<'tcx>, move_data: &'a move_data::FlowedMoveData<'tcx>,

View file

@ -16,7 +16,7 @@ use rustc::hir::*;
use rustc::hir::Node; use rustc::hir::Node;
use log::debug; use log::debug;
struct GatherMoveInfo<'c, 'tcx: 'c> { struct GatherMoveInfo<'c, 'tcx> {
id: hir::ItemLocalId, id: hir::ItemLocalId,
kind: MoveKind, kind: MoveKind,
cmt: &'c mc::cmt_<'tcx>, cmt: &'c mc::cmt_<'tcx>,
@ -91,7 +91,7 @@ pub fn gather_move_from_expr<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
gather_move(bccx, move_data, move_error_collector, move_info); gather_move(bccx, move_data, move_error_collector, move_info);
} }
pub fn gather_move_from_pat<'a, 'c, 'tcx: 'c>(bccx: &BorrowckCtxt<'a, 'tcx>, pub fn gather_move_from_pat<'a, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
move_data: &MoveData<'tcx>, move_data: &MoveData<'tcx>,
move_error_collector: &mut MoveErrorCollector<'tcx>, move_error_collector: &mut MoveErrorCollector<'tcx>,
move_pat: &hir::Pat, move_pat: &hir::Pat,
@ -121,7 +121,7 @@ pub fn gather_move_from_pat<'a, 'c, 'tcx: 'c>(bccx: &BorrowckCtxt<'a, 'tcx>,
gather_move(bccx, move_data, move_error_collector, move_info); gather_move(bccx, move_data, move_error_collector, move_info);
} }
fn gather_move<'a, 'c, 'tcx: 'c>(bccx: &BorrowckCtxt<'a, 'tcx>, fn gather_move<'a, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
move_data: &MoveData<'tcx>, move_data: &MoveData<'tcx>,
move_error_collector: &mut MoveErrorCollector<'tcx>, move_error_collector: &mut MoveErrorCollector<'tcx>,
move_info: GatherMoveInfo<'c, 'tcx>) { move_info: GatherMoveInfo<'c, 'tcx>) {

View file

@ -38,7 +38,7 @@ pub fn guarantee_lifetime<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// Private // Private
struct GuaranteeLifetimeContext<'a, 'tcx: 'a> { struct GuaranteeLifetimeContext<'a, 'tcx> {
bccx: &'a BorrowckCtxt<'a, 'tcx>, bccx: &'a BorrowckCtxt<'a, 'tcx>,
// the scope of the function body for the enclosing item // the scope of the function body for the enclosing item

View file

@ -56,7 +56,7 @@ pub fn gather_loans_in_fn<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
(all_loans, move_data) (all_loans, move_data)
} }
struct GatherLoanCtxt<'a, 'tcx: 'a> { struct GatherLoanCtxt<'a, 'tcx> {
bccx: &'a BorrowckCtxt<'a, 'tcx>, bccx: &'a BorrowckCtxt<'a, 'tcx>,
move_data: move_data::MoveData<'tcx>, move_data: move_data::MoveData<'tcx>,
move_error_collector: move_error::MoveErrorCollector<'tcx>, move_error_collector: move_error::MoveErrorCollector<'tcx>,

View file

@ -37,7 +37,7 @@ pub fn compute_restrictions<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// Private // Private
struct RestrictionsContext<'a, 'tcx: 'a> { struct RestrictionsContext<'a, 'tcx> {
bccx: &'a BorrowckCtxt<'a, 'tcx>, bccx: &'a BorrowckCtxt<'a, 'tcx>,
span: Span, span: Span,
loan_region: ty::Region<'tcx>, loan_region: ty::Region<'tcx>,

View file

@ -552,7 +552,7 @@ pub enum bckerr_code<'tcx> {
// Combination of an error code and the categorization of the expression // Combination of an error code and the categorization of the expression
// that caused it // that caused it
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
pub struct BckError<'c, 'tcx: 'c> { pub struct BckError<'c, 'tcx> {
span: Span, span: Span,
cause: AliasableViolationKind, cause: AliasableViolationKind,
cmt: &'c mc::cmt_<'tcx>, cmt: &'c mc::cmt_<'tcx>,

View file

@ -30,7 +30,7 @@ impl Variant {
} }
} }
pub struct DataflowLabeller<'a, 'tcx: 'a> { pub struct DataflowLabeller<'a, 'tcx> {
pub inner: cfg_dot::LabelledCFG<'a, 'tcx>, pub inner: cfg_dot::LabelledCFG<'a, 'tcx>,
pub variants: Vec<Variant>, pub variants: Vec<Variant>,
pub borrowck_ctxt: &'a BorrowckCtxt<'a, 'tcx>, pub borrowck_ctxt: &'a BorrowckCtxt<'a, 'tcx>,

View file

@ -27,7 +27,7 @@ use std::iter::TrustedLen;
// All Builders must have an llfn associated with them // All Builders must have an llfn associated with them
#[must_use] #[must_use]
pub struct Builder<'a, 'll: 'a, 'tcx: 'll> { pub struct Builder<'a, 'll, 'tcx> {
pub llbuilder: &'ll mut llvm::Builder<'ll>, pub llbuilder: &'ll mut llvm::Builder<'ll>,
pub cx: &'a CodegenCx<'ll, 'tcx>, pub cx: &'a CodegenCx<'ll, 'tcx>,
} }

View file

@ -34,7 +34,7 @@ use crate::abi::Abi;
/// There is one `CodegenCx` per compilation unit. Each one has its own LLVM /// There is one `CodegenCx` per compilation unit. Each one has its own LLVM
/// `llvm::Context` so that several compilation units may be optimized in parallel. /// `llvm::Context` so that several compilation units may be optimized in parallel.
/// All other LLVM data structures in the `CodegenCx` are tied to that `llvm::Context`. /// All other LLVM data structures in the `CodegenCx` are tied to that `llvm::Context`.
pub struct CodegenCx<'ll, 'tcx: 'll> { pub struct CodegenCx<'ll, 'tcx> {
pub tcx: TyCtxt<'tcx>, pub tcx: TyCtxt<'tcx>,
pub check_overflow: bool, pub check_overflow: bool,
pub use_dll_storage_attrs: bool, pub use_dll_storage_attrs: bool,

View file

@ -125,7 +125,7 @@ impl ExtraBackendMethods for LlvmCodegenBackend {
) { ) {
unsafe { allocator::codegen(tcx, mods, kind) } unsafe { allocator::codegen(tcx, mods, kind) }
} }
fn compile_codegen_unit<'a, 'tcx: 'a>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString) { fn compile_codegen_unit<'a, 'tcx>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString) {
base::compile_codegen_unit(tcx, cgu_name); base::compile_codegen_unit(tcx, cgu_name);
} }
fn target_machine_factory( fn target_machine_factory(

View file

@ -29,11 +29,11 @@ While the LLVM-specific code will be left in `rustc_codegen_llvm`, all the new t
The two most important structures for the LLVM codegen are `CodegenCx` and `Builder`. They are parametrized by multiple lifetime parameters and the type for `Value`. The two most important structures for the LLVM codegen are `CodegenCx` and `Builder`. They are parametrized by multiple lifetime parameters and the type for `Value`.
```rust ```rust
struct CodegenCx<'ll, 'tcx: 'll> { struct CodegenCx<'ll, 'tcx> {
/* ... */ /* ... */
} }
struct Builder<'a, 'll: 'a, 'tcx: 'll> { struct Builder<'a, 'll, 'tcx> {
cx: &'a CodegenCx<'ll, 'tcx>, cx: &'a CodegenCx<'ll, 'tcx>,
/* ... */ /* ... */
} }
@ -49,7 +49,7 @@ The code in `rustc_codegen_llvm` has to deal with multiple explicit lifetime par
Although there are already many lifetime parameters in the code, making it generic uncovered situations where the borrow-checker was passing only due to the special nature of the LLVM objects manipulated (they are extern pointers). For instance, a additional lifetime parameter had to be added to `LocalAnalyser` in `analyse.rs`, leading to the definition: Although there are already many lifetime parameters in the code, making it generic uncovered situations where the borrow-checker was passing only due to the special nature of the LLVM objects manipulated (they are extern pointers). For instance, a additional lifetime parameter had to be added to `LocalAnalyser` in `analyse.rs`, leading to the definition:
```rust ```rust
struct LocalAnalyzer<'mir, 'a: 'mir, 'tcx: 'a> { struct LocalAnalyzer<'mir, 'a, 'tcx> {
/* ... */ /* ... */
} }
``` ```
@ -61,7 +61,7 @@ However, the two most important structures `CodegenCx` and `Builder` are not def
Because they have to be defined by the backend, `CodegenCx` and `Builder` will be the structures implementing all the traits defining the backend's interface. These traits are defined in the folder `rustc_codegen_ssa/traits` and all the backend-agnostic code is parametrized by them. For instance, let us explain how a function in `base.rs` is parametrized: Because they have to be defined by the backend, `CodegenCx` and `Builder` will be the structures implementing all the traits defining the backend's interface. These traits are defined in the folder `rustc_codegen_ssa/traits` and all the backend-agnostic code is parametrized by them. For instance, let us explain how a function in `base.rs` is parametrized:
```rust ```rust
pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn codegen_instance<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
cx: &'a Bx::CodegenCx, cx: &'a Bx::CodegenCx,
instance: Instance<'tcx> instance: Instance<'tcx>
) { ) {
@ -74,7 +74,7 @@ In this signature, we have the two lifetime parameters explained earlier and the
On the trait side, here is an example with part of the definition of `BuilderMethods` in `traits/builder.rs`: On the trait side, here is an example with part of the definition of `BuilderMethods` in `traits/builder.rs`:
```rust ```rust
pub trait BuilderMethods<'a, 'tcx: 'a>: pub trait BuilderMethods<'a, 'tcx>:
HasCodegen<'tcx> HasCodegen<'tcx>
+ DebugInfoBuilderMethods<'tcx> + DebugInfoBuilderMethods<'tcx>
+ ArgTypeMethods<'tcx> + ArgTypeMethods<'tcx>

View file

@ -88,7 +88,7 @@ pub fn bin_op_to_fcmp_predicate(op: hir::BinOpKind) -> RealPredicate {
} }
} }
pub fn compare_simd_types<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn compare_simd_types<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
lhs: Bx::Value, lhs: Bx::Value,
rhs: Bx::Value, rhs: Bx::Value,
@ -152,7 +152,7 @@ pub fn unsized_info<'tcx, Cx: CodegenMethods<'tcx>>(
} }
/// Coerce `src` to `dst_ty`. `src_ty` must be a thin pointer. /// Coerce `src` to `dst_ty`. `src_ty` must be a thin pointer.
pub fn unsize_thin_ptr<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn unsize_thin_ptr<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
src: Bx::Value, src: Bx::Value,
src_ty: Ty<'tcx>, src_ty: Ty<'tcx>,
@ -207,7 +207,7 @@ pub fn unsize_thin_ptr<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
/// Coerce `src`, which is a reference to a value of type `src_ty`, /// Coerce `src`, which is a reference to a value of type `src_ty`,
/// to a value of type `dst_ty` and store the result in `dst` /// to a value of type `dst_ty` and store the result in `dst`
pub fn coerce_unsized_into<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn coerce_unsized_into<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
src: PlaceRef<'tcx, Bx::Value>, src: PlaceRef<'tcx, Bx::Value>,
dst: PlaceRef<'tcx, Bx::Value> dst: PlaceRef<'tcx, Bx::Value>
@ -266,7 +266,7 @@ pub fn coerce_unsized_into<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
} }
} }
pub fn cast_shift_expr_rhs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn cast_shift_expr_rhs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
op: hir::BinOpKind, op: hir::BinOpKind,
lhs: Bx::Value, lhs: Bx::Value,
@ -275,7 +275,7 @@ pub fn cast_shift_expr_rhs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
cast_shift_rhs(bx, op, lhs, rhs) cast_shift_rhs(bx, op, lhs, rhs)
} }
fn cast_shift_rhs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( fn cast_shift_rhs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
op: hir::BinOpKind, op: hir::BinOpKind,
lhs: Bx::Value, lhs: Bx::Value,
@ -316,7 +316,7 @@ pub fn wants_msvc_seh(sess: &Session) -> bool {
sess.target.target.options.is_like_msvc sess.target.target.options.is_like_msvc
} }
pub fn from_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn from_immediate<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
val: Bx::Value val: Bx::Value
) -> Bx::Value { ) -> Bx::Value {
@ -327,7 +327,7 @@ pub fn from_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
} }
} }
pub fn to_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn to_immediate<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
val: Bx::Value, val: Bx::Value,
layout: layout::TyLayout<'_>, layout: layout::TyLayout<'_>,
@ -338,7 +338,7 @@ pub fn to_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
val val
} }
pub fn to_immediate_scalar<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn to_immediate_scalar<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
val: Bx::Value, val: Bx::Value,
scalar: &layout::Scalar, scalar: &layout::Scalar,
@ -349,7 +349,7 @@ pub fn to_immediate_scalar<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
val val
} }
pub fn memcpy_ty<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn memcpy_ty<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
dst: Bx::Value, dst: Bx::Value,
dst_align: Align, dst_align: Align,
@ -366,7 +366,7 @@ pub fn memcpy_ty<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
bx.memcpy(dst, dst_align, src, src_align, bx.cx().const_usize(size), flags); bx.memcpy(dst, dst_align, src, src_align, bx.cx().const_usize(size), flags);
} }
pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn codegen_instance<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
cx: &'a Bx::CodegenCx, cx: &'a Bx::CodegenCx,
instance: Instance<'tcx>, instance: Instance<'tcx>,
) { ) {
@ -387,7 +387,7 @@ pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
/// Creates the `main` function which will initialize the rust runtime and call /// Creates the `main` function which will initialize the rust runtime and call
/// users main function. /// users main function.
pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
cx: &'a Bx::CodegenCx cx: &'a Bx::CodegenCx
) { ) {
let (main_def_id, span) = match cx.tcx().entry_fn(LOCAL_CRATE) { let (main_def_id, span) = match cx.tcx().entry_fn(LOCAL_CRATE) {
@ -412,7 +412,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
None => {} // Do nothing. None => {} // Do nothing.
} }
fn create_entry_fn<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( fn create_entry_fn<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
cx: &'a Bx::CodegenCx, cx: &'a Bx::CodegenCx,
sp: Span, sp: Span,
rust_main: Bx::Value, rust_main: Bx::Value,

View file

@ -137,7 +137,7 @@ pub fn langcall(tcx: TyCtxt<'_>, span: Option<Span>, msg: &str, li: LangItem) ->
// all shifts). For 32- and 64-bit types, this matches the semantics // all shifts). For 32- and 64-bit types, this matches the semantics
// of Java. (See related discussion on #1877 and #10183.) // of Java. (See related discussion on #1877 and #10183.)
pub fn build_unchecked_lshift<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn build_unchecked_lshift<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
lhs: Bx::Value, lhs: Bx::Value,
rhs: Bx::Value rhs: Bx::Value
@ -148,7 +148,7 @@ pub fn build_unchecked_lshift<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
bx.shl(lhs, rhs) bx.shl(lhs, rhs)
} }
pub fn build_unchecked_rshift<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn build_unchecked_rshift<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
lhs_t: Ty<'tcx>, lhs_t: Ty<'tcx>,
lhs: Bx::Value, lhs: Bx::Value,
@ -165,7 +165,7 @@ pub fn build_unchecked_rshift<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
} }
} }
fn shift_mask_rhs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( fn shift_mask_rhs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
rhs: Bx::Value rhs: Bx::Value
) -> Bx::Value { ) -> Bx::Value {
@ -174,7 +174,7 @@ fn shift_mask_rhs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
bx.and(rhs, shift_val) bx.and(rhs, shift_val)
} }
pub fn shift_mask_val<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn shift_mask_val<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
llty: Bx::Type, llty: Bx::Type,
mask_llty: Bx::Type, mask_llty: Bx::Type,

View file

@ -7,7 +7,7 @@ use crate::common::IntPredicate;
use crate::meth; use crate::meth;
use crate::traits::*; use crate::traits::*;
pub fn size_and_align_of_dst<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
t: Ty<'tcx>, t: Ty<'tcx>,
info: Option<Bx::Value> info: Option<Bx::Value>

View file

@ -12,7 +12,7 @@ pub const DESTRUCTOR: VirtualIndex = VirtualIndex(0);
pub const SIZE: VirtualIndex = VirtualIndex(1); pub const SIZE: VirtualIndex = VirtualIndex(1);
pub const ALIGN: VirtualIndex = VirtualIndex(2); pub const ALIGN: VirtualIndex = VirtualIndex(2);
impl<'a, 'tcx: 'a> VirtualIndex { impl<'a, 'tcx> VirtualIndex {
pub fn from_index(index: usize) -> Self { pub fn from_index(index: usize) -> Self {
VirtualIndex(index as u64 + 3) VirtualIndex(index as u64 + 3)
} }

View file

@ -12,7 +12,7 @@ use rustc::ty::layout::{LayoutOf, HasTyCtxt};
use super::FunctionCx; use super::FunctionCx;
use crate::traits::*; use crate::traits::*;
pub fn non_ssa_locals<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
fx: &FunctionCx<'a, 'tcx, Bx> fx: &FunctionCx<'a, 'tcx, Bx>
) -> BitSet<mir::Local> { ) -> BitSet<mir::Local> {
let mir = fx.mir; let mir = fx.mir;
@ -43,7 +43,7 @@ pub fn non_ssa_locals<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
analyzer.non_ssa_locals analyzer.non_ssa_locals
} }
struct LocalAnalyzer<'mir, 'a: 'mir, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> { struct LocalAnalyzer<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
fx: &'mir FunctionCx<'a, 'tcx, Bx>, fx: &'mir FunctionCx<'a, 'tcx, Bx>,
dominators: Dominators<mir::BasicBlock>, dominators: Dominators<mir::BasicBlock>,
non_ssa_locals: BitSet<mir::Local>, non_ssa_locals: BitSet<mir::Local>,
@ -94,7 +94,7 @@ impl<Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
} }
} }
impl<'mir, 'a: 'mir, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx> impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
for LocalAnalyzer<'mir, 'a, 'tcx, Bx> { for LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
fn visit_assign(&mut self, fn visit_assign(&mut self,
place: &mir::Place<'tcx>, place: &mir::Place<'tcx>,

View file

@ -151,7 +151,7 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'a, 'tcx> {
} }
/// Codegen implementations for some terminator variants. /// Codegen implementations for some terminator variants.
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
/// Generates code for a `Resume` terminator. /// Generates code for a `Resume` terminator.
fn codegen_resume_terminator<'b>( fn codegen_resume_terminator<'b>(
&mut self, &mut self,
@ -788,7 +788,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
} }
} }
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn codegen_block( pub fn codegen_block(
&mut self, &mut self,
bb: mir::BasicBlock, bb: mir::BasicBlock,

View file

@ -8,7 +8,7 @@ use crate::traits::*;
use super::FunctionCx; use super::FunctionCx;
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn eval_mir_constant( pub fn eval_mir_constant(
&mut self, &mut self,
constant: &mir::Constant<'tcx>, constant: &mir::Constant<'tcx>,

View file

@ -23,7 +23,7 @@ use rustc::mir::traversal;
use self::operand::{OperandRef, OperandValue}; use self::operand::{OperandRef, OperandValue};
/// Master context for codegenning from MIR. /// Master context for codegenning from MIR.
pub struct FunctionCx<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> { pub struct FunctionCx<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
instance: Instance<'tcx>, instance: Instance<'tcx>,
mir: &'a mir::Body<'tcx>, mir: &'a mir::Body<'tcx>,
@ -87,7 +87,7 @@ pub struct FunctionCx<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> {
va_list_ref: Option<PlaceRef<'tcx, Bx::Value>>, va_list_ref: Option<PlaceRef<'tcx, Bx::Value>>,
} }
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn monomorphize<T>(&self, value: &T) -> T pub fn monomorphize<T>(&self, value: &T) -> T
where T: TypeFoldable<'tcx> where T: TypeFoldable<'tcx>
{ {
@ -167,7 +167,7 @@ enum LocalRef<'tcx, V> {
Operand(Option<OperandRef<'tcx, V>>), Operand(Option<OperandRef<'tcx, V>>),
} }
impl<'a, 'tcx: 'a, V: CodegenObject> LocalRef<'tcx, V> { impl<'a, 'tcx, V: CodegenObject> LocalRef<'tcx, V> {
fn new_operand<Bx: BuilderMethods<'a, 'tcx, Value = V>>( fn new_operand<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
bx: &mut Bx, bx: &mut Bx,
layout: TyLayout<'tcx>, layout: TyLayout<'tcx>,
@ -185,7 +185,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> LocalRef<'tcx, V> {
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
cx: &'a Bx::CodegenCx, cx: &'a Bx::CodegenCx,
llfn: Bx::Value, llfn: Bx::Value,
mir: &'a Body<'tcx>, mir: &'a Body<'tcx>,
@ -351,7 +351,7 @@ pub fn codegen_mir<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
} }
} }
fn create_funclets<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( fn create_funclets<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
mir: &'a Body<'tcx>, mir: &'a Body<'tcx>,
bx: &mut Bx, bx: &mut Bx,
cleanup_kinds: &IndexVec<mir::BasicBlock, CleanupKind>, cleanup_kinds: &IndexVec<mir::BasicBlock, CleanupKind>,
@ -420,7 +420,7 @@ fn create_funclets<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
/// Produces, for each argument, a `Value` pointing at the /// Produces, for each argument, a `Value` pointing at the
/// argument's value. As arguments are places, these are always /// argument's value. As arguments are places, these are always
/// indirect. /// indirect.
fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( fn arg_local_refs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
fx: &FunctionCx<'a, 'tcx, Bx>, fx: &FunctionCx<'a, 'tcx, Bx>,
memory_locals: &BitSet<mir::Local>, memory_locals: &BitSet<mir::Local>,

View file

@ -53,7 +53,7 @@ impl<V: CodegenObject> fmt::Debug for OperandRef<'tcx, V> {
} }
} }
impl<'a, 'tcx: 'a, V: CodegenObject> OperandRef<'tcx, V> { impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
pub fn new_zst<Bx: BuilderMethods<'a, 'tcx, Value = V>>( pub fn new_zst<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
bx: &mut Bx, bx: &mut Bx,
layout: TyLayout<'tcx> layout: TyLayout<'tcx>
@ -266,7 +266,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> OperandRef<'tcx, V> {
} }
} }
impl<'a, 'tcx: 'a, V: CodegenObject> OperandValue<V> { impl<'a, 'tcx, V: CodegenObject> OperandValue<V> {
pub fn store<Bx: BuilderMethods<'a, 'tcx, Value = V>>( pub fn store<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
self, self,
bx: &mut Bx, bx: &mut Bx,
@ -376,7 +376,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> OperandValue<V> {
} }
} }
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
fn maybe_codegen_consume_direct( fn maybe_codegen_consume_direct(
&mut self, &mut self,
bx: &mut Bx, bx: &mut Bx,

View file

@ -26,7 +26,7 @@ pub struct PlaceRef<'tcx, V> {
pub align: Align, pub align: Align,
} }
impl<'a, 'tcx: 'a, V: CodegenObject> PlaceRef<'tcx, V> { impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
pub fn new_sized( pub fn new_sized(
llval: V, llval: V,
layout: TyLayout<'tcx>, layout: TyLayout<'tcx>,
@ -98,7 +98,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> PlaceRef<'tcx, V> {
} }
impl<'a, 'tcx: 'a, V: CodegenObject> PlaceRef<'tcx, V> { impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
/// Access a field, at a point when the value's case is known. /// Access a field, at a point when the value's case is known.
pub fn project_field<Bx: BuilderMethods<'a, 'tcx, Value = V>>( pub fn project_field<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
self, bx: &mut Bx, self, bx: &mut Bx,
@ -386,7 +386,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> PlaceRef<'tcx, V> {
} }
} }
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn codegen_place( pub fn codegen_place(
&mut self, &mut self,
bx: &mut Bx, bx: &mut Bx,

View file

@ -18,7 +18,7 @@ use super::{FunctionCx, LocalRef};
use super::operand::{OperandRef, OperandValue}; use super::operand::{OperandRef, OperandValue};
use super::place::PlaceRef; use super::place::PlaceRef;
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn codegen_rvalue( pub fn codegen_rvalue(
&mut self, &mut self,
mut bx: Bx, mut bx: Bx,
@ -687,7 +687,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
} }
} }
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn rvalue_creates_operand(&self, rvalue: &mir::Rvalue<'tcx>) -> bool { pub fn rvalue_creates_operand(&self, rvalue: &mir::Rvalue<'tcx>) -> bool {
match *rvalue { match *rvalue {
mir::Rvalue::Ref(..) | mir::Rvalue::Ref(..) |
@ -712,7 +712,7 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
} }
} }
fn cast_int_to_float<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( fn cast_int_to_float<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
signed: bool, signed: bool,
x: Bx::Value, x: Bx::Value,
@ -746,7 +746,7 @@ fn cast_int_to_float<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
} }
} }
fn cast_float_to_int<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( fn cast_float_to_int<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
bx: &mut Bx, bx: &mut Bx,
signed: bool, signed: bool,
x: Bx::Value, x: Bx::Value,

View file

@ -6,7 +6,7 @@ use super::LocalRef;
use super::OperandValue; use super::OperandValue;
use crate::traits::*; use crate::traits::*;
impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
pub fn codegen_statement( pub fn codegen_statement(
&mut self, &mut self,
mut bx: Bx, mut bx: Bx,

View file

@ -6,7 +6,7 @@ use crate::traits::*;
use rustc::mir::mono::MonoItem; use rustc::mir::mono::MonoItem;
pub trait MonoItemExt<'a, 'tcx: 'a> { pub trait MonoItemExt<'a, 'tcx> {
fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx); fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx);
fn predefine<Bx: BuilderMethods<'a, 'tcx>>( fn predefine<Bx: BuilderMethods<'a, 'tcx>>(
&self, &self,
@ -17,7 +17,7 @@ pub trait MonoItemExt<'a, 'tcx: 'a> {
fn to_raw_string(&self) -> String; fn to_raw_string(&self) -> String;
} }
impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> { impl<'a, 'tcx> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> {
fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx) { fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx) {
debug!("BEGIN IMPLEMENTING '{} ({})' in cgu {}", debug!("BEGIN IMPLEMENTING '{} ({})' in cgu {}",
self.to_string(cx.tcx(), true), self.to_string(cx.tcx(), true),

View file

@ -44,7 +44,7 @@ pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Se
mods: &mut Self::Module, mods: &mut Self::Module,
kind: AllocatorKind, kind: AllocatorKind,
); );
fn compile_codegen_unit<'a, 'tcx: 'a>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString); fn compile_codegen_unit<'a, 'tcx>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString);
// If find_features is true this won't access `sess.crate_types` by assuming // If find_features is true this won't access `sess.crate_types` by assuming
// that `is_pie_binary` is false. When we discover LLVM target features // that `is_pie_binary` is false. When we discover LLVM target features
// `sess.crate_types` is uninitialized so we cannot access it. // `sess.crate_types` is uninitialized so we cannot access it.

View file

@ -22,7 +22,7 @@ pub enum OverflowOp {
Mul, Mul,
} }
pub trait BuilderMethods<'a, 'tcx: 'a>: pub trait BuilderMethods<'a, 'tcx>:
HasCodegen<'tcx> HasCodegen<'tcx>
+ DebugInfoBuilderMethods<'tcx> + DebugInfoBuilderMethods<'tcx>
+ ArgTypeMethods<'tcx> + ArgTypeMethods<'tcx>

View file

@ -453,7 +453,7 @@ impl<'a> pprust::PpAnn for HygieneAnnotation<'a> {
} }
} }
struct TypedAnnotation<'a, 'tcx: 'a> { struct TypedAnnotation<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
tables: Cell<&'a ty::TypeckTables<'tcx>>, tables: Cell<&'a ty::TypeckTables<'tcx>>,
} }

View file

@ -1088,7 +1088,7 @@ impl TypeAliasBounds {
// We use a HIR visitor to walk the type. // We use a HIR visitor to walk the type.
use rustc::hir::intravisit::{self, Visitor}; use rustc::hir::intravisit::{self, Visitor};
struct WalkAssocTypes<'a, 'db> where 'db: 'a { struct WalkAssocTypes<'a, 'db> where 'db {
err: &'a mut DiagnosticBuilder<'db> err: &'a mut DiagnosticBuilder<'db>
} }
impl<'a, 'db, 'v> Visitor<'v> for WalkAssocTypes<'a, 'db> { impl<'a, 'db, 'v> Visitor<'v> for WalkAssocTypes<'a, 'db> {

View file

@ -505,7 +505,7 @@ declare_lint! {
declare_lint_pass!(ImproperCTypes => [IMPROPER_CTYPES]); declare_lint_pass!(ImproperCTypes => [IMPROPER_CTYPES]);
struct ImproperCTypesVisitor<'a, 'tcx: 'a> { struct ImproperCTypesVisitor<'a, 'tcx> {
cx: &'a LateContext<'a, 'tcx>, cx: &'a LateContext<'a, 'tcx>,
} }

View file

@ -295,7 +295,7 @@ impl<'a> CrateLoader<'a> {
path_kind: PathKind, path_kind: PathKind,
) -> Option<(LoadResult, Option<Library>)> ) -> Option<(LoadResult, Option<Library>)>
where where
'a: 'b 'a
{ {
// Use a new locator Context so trying to load a proc macro doesn't affect the error // Use a new locator Context so trying to load a proc macro doesn't affect the error
// message we emit // message we emit

View file

@ -35,7 +35,7 @@ use syntax::ext::hygiene::Mark;
use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP, NO_EXPANSION}; use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP, NO_EXPANSION};
use log::debug; use log::debug;
pub struct DecodeContext<'a, 'tcx: 'a> { pub struct DecodeContext<'a, 'tcx> {
opaque: opaque::Decoder<'a>, opaque: opaque::Decoder<'a>,
cdata: Option<&'a CrateMetadata>, cdata: Option<&'a CrateMetadata>,
sess: Option<&'a Session>, sess: Option<&'a Session>,
@ -128,7 +128,7 @@ impl<'a, 'tcx> Metadata<'a, 'tcx> for (&'a CrateMetadata, TyCtxt<'tcx>) {
} }
} }
impl<'a, 'tcx: 'a, T: Decodable> Lazy<T> { impl<'a, 'tcx, T: Decodable> Lazy<T> {
pub fn decode<M: Metadata<'a, 'tcx>>(self, meta: M) -> T { pub fn decode<M: Metadata<'a, 'tcx>>(self, meta: M) -> T {
let mut dcx = meta.decoder(self.position); let mut dcx = meta.decoder(self.position);
dcx.lazy_state = LazyState::NodeStart(self.position); dcx.lazy_state = LazyState::NodeStart(self.position);
@ -136,7 +136,7 @@ impl<'a, 'tcx: 'a, T: Decodable> Lazy<T> {
} }
} }
impl<'a, 'tcx: 'a, T: Decodable> LazySeq<T> { impl<'a, 'tcx, T: Decodable> LazySeq<T> {
pub fn decode<M: Metadata<'a, 'tcx>>( pub fn decode<M: Metadata<'a, 'tcx>>(
self, self,
meta: M, meta: M,

View file

@ -160,7 +160,7 @@ impl<'tcx> BorrowSet<'tcx> {
} }
} }
struct GatherBorrows<'a, 'tcx: 'a> { struct GatherBorrows<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
idx_vec: IndexVec<BorrowIndex, BorrowData<'tcx>>, idx_vec: IndexVec<BorrowIndex, BorrowData<'tcx>>,

View file

@ -22,7 +22,7 @@ use std::fmt;
use std::rc::Rc; use std::rc::Rc;
// (forced to be `pub` due to its use as an associated type below.) // (forced to be `pub` due to its use as an associated type below.)
crate struct Flows<'b, 'tcx: 'b> { crate struct Flows<'b, 'tcx> {
borrows: FlowAtLocation<'tcx, Borrows<'b, 'tcx>>, borrows: FlowAtLocation<'tcx, Borrows<'b, 'tcx>>,
pub uninits: FlowAtLocation<'tcx, MaybeUninitializedPlaces<'b, 'tcx>>, pub uninits: FlowAtLocation<'tcx, MaybeUninitializedPlaces<'b, 'tcx>>,
pub ever_inits: FlowAtLocation<'tcx, EverInitializedPlaces<'b, 'tcx>>, pub ever_inits: FlowAtLocation<'tcx, EverInitializedPlaces<'b, 'tcx>>,

View file

@ -423,7 +423,7 @@ fn downgrade_if_error(diag: &mut Diagnostic) {
} }
} }
pub struct MirBorrowckCtxt<'cx, 'tcx: 'cx> { pub struct MirBorrowckCtxt<'cx, 'tcx> {
infcx: &'cx InferCtxt<'cx, 'tcx>, infcx: &'cx InferCtxt<'cx, 'tcx>,
body: &'cx Body<'tcx>, body: &'cx Body<'tcx>,
mir_def_id: DefId, mir_def_id: DefId,
@ -891,7 +891,7 @@ enum InitializationRequiringAction {
PartialAssignment, PartialAssignment,
} }
struct RootPlace<'d, 'tcx: 'd> { struct RootPlace<'d, 'tcx> {
place: &'d Place<'tcx>, place: &'d Place<'tcx>,
is_local_mutation_allowed: LocalMutationIsAllowed, is_local_mutation_allowed: LocalMutationIsAllowed,
} }
@ -1693,7 +1693,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
fn move_path_closest_to<'a>( fn move_path_closest_to<'a>(
&mut self, &mut self,
place: &'a Place<'tcx>, place: &'a Place<'tcx>,
) -> Result<(&'a Place<'tcx>, MovePathIndex), NoMovePathFound> where 'cx: 'a { ) -> Result<(&'a Place<'tcx>, MovePathIndex), NoMovePathFound> where 'cx {
let mut last_prefix = place; let mut last_prefix = place;
for prefix in self.prefixes(place, PrefixSet::All) { for prefix in self.prefixes(place, PrefixSet::All) {
if let Some(mpi) = self.move_path_for_place(prefix) { if let Some(mpi) = self.move_path_for_place(prefix) {

View file

@ -35,7 +35,7 @@ pub(super) fn generate_constraints<'cx, 'tcx>(
} }
/// 'cg = the duration of the constraint generation process itself. /// 'cg = the duration of the constraint generation process itself.
struct ConstraintGeneration<'cg, 'cx: 'cg, 'tcx: 'cx> { struct ConstraintGeneration<'cg, 'cx, 'tcx> {
infcx: &'cg InferCtxt<'cx, 'tcx>, infcx: &'cg InferCtxt<'cx, 'tcx>,
all_facts: &'cg mut Option<AllFacts>, all_facts: &'cg mut Option<AllFacts>,
location_table: &'cg LocationTable, location_table: &'cg LocationTable,

View file

@ -27,7 +27,7 @@ crate fn find<'tcx>(
uf.find() uf.find()
} }
struct UseFinder<'cx, 'tcx: 'cx> { struct UseFinder<'cx, 'tcx> {
body: &'cx Body<'tcx>, body: &'cx Body<'tcx>,
regioncx: &'cx Rc<RegionInferenceContext<'tcx>>, regioncx: &'cx Rc<RegionInferenceContext<'tcx>>,
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
@ -99,7 +99,7 @@ impl<'cx, 'tcx> UseFinder<'cx, 'tcx> {
} }
} }
struct DefUseVisitor<'cx, 'tcx: 'cx> { struct DefUseVisitor<'cx, 'tcx> {
body: &'cx Body<'tcx>, body: &'cx Body<'tcx>,
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
region_vid: RegionVid, region_vid: RegionVid,

View file

@ -43,7 +43,7 @@ pub(super) fn generate_invalidates<'tcx>(
} }
} }
struct InvalidationGenerator<'cx, 'tcx: 'cx> { struct InvalidationGenerator<'cx, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
all_facts: &'cx mut AllFacts, all_facts: &'cx mut AllFacts,
location_table: &'cx LocationTable, location_table: &'cx LocationTable,

View file

@ -29,7 +29,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
} }
} }
struct RawConstraints<'a, 'tcx: 'a> { struct RawConstraints<'a, 'tcx> {
regioncx: &'a RegionInferenceContext<'tcx>, regioncx: &'a RegionInferenceContext<'tcx>,
} }
@ -78,7 +78,7 @@ impl<'a, 'this, 'tcx> dot::GraphWalk<'this> for RawConstraints<'a, 'tcx> {
} }
} }
struct SccConstraints<'a, 'tcx: 'a> { struct SccConstraints<'a, 'tcx> {
regioncx: &'a RegionInferenceContext<'tcx>, regioncx: &'a RegionInferenceContext<'tcx>,
nodes_per_scc: IndexVec<ConstraintSccIndex, Vec<RegionVid>>, nodes_per_scc: IndexVec<ConstraintSccIndex, Vec<RegionVid>>,
} }

View file

@ -13,7 +13,7 @@ use rustc::ty::subst::UnpackedKind;
use rustc::ty::{self, TyCtxt}; use rustc::ty::{self, TyCtxt};
use syntax_pos::DUMMY_SP; use syntax_pos::DUMMY_SP;
crate struct ConstraintConversion<'a, 'tcx: 'a> { crate struct ConstraintConversion<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
universal_regions: &'a UniversalRegions<'tcx>, universal_regions: &'a UniversalRegions<'tcx>,

View file

@ -219,7 +219,7 @@ impl UniversalRegionRelations<'tcx> {
} }
} }
struct UniversalRegionRelationsBuilder<'this, 'tcx: 'this> { struct UniversalRegionRelationsBuilder<'this, 'tcx> {
infcx: &'this InferCtxt<'this, 'tcx>, infcx: &'this InferCtxt<'this, 'tcx>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
universal_regions: Rc<UniversalRegions<'tcx>>, universal_regions: Rc<UniversalRegions<'tcx>>,

View file

@ -60,9 +60,9 @@ pub(super) fn trace(
/// Contextual state for the type-liveness generator. /// Contextual state for the type-liveness generator.
struct LivenessContext<'me, 'typeck, 'flow, 'tcx> struct LivenessContext<'me, 'typeck, 'flow, 'tcx>
where where
'typeck: 'me, 'typeck,
'flow: 'me, 'flow,
'tcx: 'typeck + 'flow, 'tcx,
{ {
/// Current type-checker, giving us our inference context etc. /// Current type-checker, giving us our inference context etc.
typeck: &'me mut TypeChecker<'typeck, 'tcx>, typeck: &'me mut TypeChecker<'typeck, 'tcx>,
@ -98,9 +98,9 @@ struct DropData<'tcx> {
struct LivenessResults<'me, 'typeck, 'flow, 'tcx> struct LivenessResults<'me, 'typeck, 'flow, 'tcx>
where where
'typeck: 'me, 'typeck,
'flow: 'me, 'flow,
'tcx: 'typeck + 'flow, 'tcx,
{ {
cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>, cx: LivenessContext<'me, 'typeck, 'flow, 'tcx>,

View file

@ -251,7 +251,7 @@ enum FieldAccessError {
/// The sanitize_XYZ methods here take an MIR object and compute its /// The sanitize_XYZ methods here take an MIR object and compute its
/// type, calling `span_mirbug` and returning an error type if there /// type, calling `span_mirbug` and returning an error type if there
/// is a problem. /// is a problem.
struct TypeVerifier<'a, 'b: 'a, 'tcx: 'b> { struct TypeVerifier<'a, 'b, 'tcx> {
cx: &'a mut TypeChecker<'b, 'tcx>, cx: &'a mut TypeChecker<'b, 'tcx>,
body: &'b Body<'tcx>, body: &'b Body<'tcx>,
last_span: Span, last_span: Span,
@ -830,7 +830,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
/// constraints needed for it to be valid and well-typed. Along the /// constraints needed for it to be valid and well-typed. Along the
/// way, it accrues region constraints -- these can later be used by /// way, it accrues region constraints -- these can later be used by
/// NLL region checking. /// NLL region checking.
struct TypeChecker<'a, 'tcx: 'a> { struct TypeChecker<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>, infcx: &'a InferCtxt<'a, 'tcx>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
last_span: Span, last_span: Span,
@ -845,7 +845,7 @@ struct TypeChecker<'a, 'tcx: 'a> {
universal_region_relations: &'a UniversalRegionRelations<'tcx>, universal_region_relations: &'a UniversalRegionRelations<'tcx>,
} }
struct BorrowCheckContext<'a, 'tcx: 'a> { struct BorrowCheckContext<'a, 'tcx> {
universal_regions: &'a UniversalRegions<'tcx>, universal_regions: &'a UniversalRegions<'tcx>,
location_table: &'a LocationTable, location_table: &'a LocationTable,
all_facts: &'a mut Option<AllFacts>, all_facts: &'a mut Option<AllFacts>,

View file

@ -34,7 +34,7 @@ pub(super) fn relate_types<'tcx>(
Ok(()) Ok(())
} }
struct NllTypeRelatingDelegate<'me, 'bccx: 'me, 'tcx: 'bccx> { struct NllTypeRelatingDelegate<'me, 'bccx, 'tcx> {
infcx: &'me InferCtxt<'me, 'tcx>, infcx: &'me InferCtxt<'me, 'tcx>,
borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>, borrowck_context: Option<&'me mut BorrowCheckContext<'bccx, 'tcx>>,

View file

@ -363,7 +363,7 @@ impl<'tcx> UniversalRegions<'tcx> {
} }
} }
struct UniversalRegionsBuilder<'cx, 'tcx: 'cx> { struct UniversalRegionsBuilder<'cx, 'tcx> {
infcx: &'cx InferCtxt<'cx, 'tcx>, infcx: &'cx InferCtxt<'cx, 'tcx>,
mir_def_id: DefId, mir_def_id: DefId,
mir_hir_id: HirId, mir_hir_id: HirId,

View file

@ -36,7 +36,7 @@ impl<'tcx> IsPrefixOf<'tcx> for Place<'tcx> {
} }
} }
pub(super) struct Prefixes<'cx, 'tcx: 'cx> { pub(super) struct Prefixes<'cx, 'tcx> {
body: &'cx Body<'tcx>, body: &'cx Body<'tcx>,
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
kind: PrefixSet, kind: PrefixSet,

View file

@ -46,7 +46,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
/// MIR visitor for collecting used mutable variables. /// MIR visitor for collecting used mutable variables.
/// The 'visit lifetime represents the duration of the MIR walk. /// The 'visit lifetime represents the duration of the MIR walk.
struct GatherUsedMutsVisitor<'visit, 'cx: 'visit, 'tcx: 'cx> { struct GatherUsedMutsVisitor<'visit, 'cx, 'tcx> {
temporary_used_locals: FxHashSet<Local>, temporary_used_locals: FxHashSet<Local>,
never_initialized_mut_locals: &'visit mut FxHashSet<Local>, never_initialized_mut_locals: &'visit mut FxHashSet<Local>,
mbcx: &'visit mut MirBorrowckCtxt<'cx, 'tcx>, mbcx: &'visit mut MirBorrowckCtxt<'cx, 'tcx>,

View file

@ -661,7 +661,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
} }
#[derive(Debug)] #[derive(Debug)]
pub struct Candidate<'pat, 'tcx: 'pat> { pub struct Candidate<'pat, 'tcx> {
// span of the original pattern that gave rise to this candidate // span of the original pattern that gave rise to this candidate
span: Span, span: Span,
@ -705,7 +705,7 @@ struct Ascription<'tcx> {
} }
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct MatchPair<'pat, 'tcx: 'pat> { pub struct MatchPair<'pat, 'tcx> {
// this place... // this place...
place: Place<'tcx>, place: Place<'tcx>,
@ -1691,7 +1691,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
&mut self, &mut self,
block: BasicBlock, block: BasicBlock,
bindings: impl IntoIterator<Item = &'b Binding<'tcx>>, bindings: impl IntoIterator<Item = &'b Binding<'tcx>>,
) where 'tcx: 'b { ) where 'tcx {
debug!("bind_matched_candidate_for_arm_body(block={:?})", block); debug!("bind_matched_candidate_for_arm_body(block={:?})", block);
let re_erased = self.hir.tcx().lifetimes.re_erased; let re_erased = self.hir.tcx().lifetimes.re_erased;

View file

@ -241,7 +241,7 @@ impl BlockFrame {
#[derive(Debug)] #[derive(Debug)]
struct BlockContext(Vec<BlockFrame>); struct BlockContext(Vec<BlockFrame>);
struct Builder<'a, 'tcx: 'a> { struct Builder<'a, 'tcx> {
hir: Cx<'a, 'tcx>, hir: Cx<'a, 'tcx>,
cfg: CFG<'tcx>, cfg: CFG<'tcx>,

View file

@ -11,11 +11,11 @@ use crate::dataflow::BitDenotation;
/// This is used to compute which locals are live during a yield expression for /// This is used to compute which locals are live during a yield expression for
/// immovable generators. /// immovable generators.
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct HaveBeenBorrowedLocals<'a, 'tcx: 'a> { pub struct HaveBeenBorrowedLocals<'a, 'tcx> {
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
} }
impl<'a, 'tcx: 'a> HaveBeenBorrowedLocals<'a, 'tcx> { impl<'a, 'tcx> HaveBeenBorrowedLocals<'a, 'tcx> {
pub fn new(body: &'a Body<'tcx>) pub fn new(body: &'a Body<'tcx>)
-> Self { -> Self {
HaveBeenBorrowedLocals { body } HaveBeenBorrowedLocals { body }
@ -97,7 +97,7 @@ impl<'a, 'tcx> InitialFlow for HaveBeenBorrowedLocals<'a, 'tcx> {
} }
} }
struct BorrowedLocalsVisitor<'b, 'c: 'b> { struct BorrowedLocalsVisitor<'b, 'c> {
sets: &'b mut BlockSets<'c, Local>, sets: &'b mut BlockSets<'c, Local>,
} }

View file

@ -29,7 +29,7 @@ newtype_index! {
/// `BorrowIndex`, and maps each such index to a `BorrowData` /// `BorrowIndex`, and maps each such index to a `BorrowData`
/// describing the borrow. These indexes are used for representing the /// describing the borrow. These indexes are used for representing the
/// borrows in compact bitvectors. /// borrows in compact bitvectors.
pub struct Borrows<'a, 'tcx: 'a> { pub struct Borrows<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
body: &'a Body<'tcx>, body: &'a Body<'tcx>,

View file

@ -63,7 +63,7 @@ pub(super) mod borrows;
/// Similarly, at a given `drop` statement, the set-intersection /// Similarly, at a given `drop` statement, the set-intersection
/// between this data and `MaybeUninitializedPlaces` yields the set of /// between this data and `MaybeUninitializedPlaces` yields the set of
/// places that would require a dynamic drop-flag at that statement. /// places that would require a dynamic drop-flag at that statement.
pub struct MaybeInitializedPlaces<'a, 'tcx: 'a> { pub struct MaybeInitializedPlaces<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
mdpe: &'a MoveDataParamEnv<'tcx>, mdpe: &'a MoveDataParamEnv<'tcx>,
@ -114,7 +114,7 @@ impl<'a, 'tcx> HasMoveData<'tcx> for MaybeInitializedPlaces<'a, 'tcx> {
/// Similarly, at a given `drop` statement, the set-intersection /// Similarly, at a given `drop` statement, the set-intersection
/// between this data and `MaybeInitializedPlaces` yields the set of /// between this data and `MaybeInitializedPlaces` yields the set of
/// places that would require a dynamic drop-flag at that statement. /// places that would require a dynamic drop-flag at that statement.
pub struct MaybeUninitializedPlaces<'a, 'tcx: 'a> { pub struct MaybeUninitializedPlaces<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
mdpe: &'a MoveDataParamEnv<'tcx>, mdpe: &'a MoveDataParamEnv<'tcx>,
@ -164,19 +164,19 @@ impl<'a, 'tcx> HasMoveData<'tcx> for MaybeUninitializedPlaces<'a, 'tcx> {
/// Similarly, at a given `drop` statement, the set-difference between /// Similarly, at a given `drop` statement, the set-difference between
/// this data and `MaybeInitializedPlaces` yields the set of places /// this data and `MaybeInitializedPlaces` yields the set of places
/// that would require a dynamic drop-flag at that statement. /// that would require a dynamic drop-flag at that statement.
pub struct DefinitelyInitializedPlaces<'a, 'tcx: 'a> { pub struct DefinitelyInitializedPlaces<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
mdpe: &'a MoveDataParamEnv<'tcx>, mdpe: &'a MoveDataParamEnv<'tcx>,
} }
impl<'a, 'tcx: 'a> DefinitelyInitializedPlaces<'a, 'tcx> { impl<'a, 'tcx> DefinitelyInitializedPlaces<'a, 'tcx> {
pub fn new(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, mdpe: &'a MoveDataParamEnv<'tcx>) -> Self { pub fn new(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, mdpe: &'a MoveDataParamEnv<'tcx>) -> Self {
DefinitelyInitializedPlaces { tcx: tcx, body: body, mdpe: mdpe } DefinitelyInitializedPlaces { tcx: tcx, body: body, mdpe: mdpe }
} }
} }
impl<'a, 'tcx: 'a> HasMoveData<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx> { impl<'a, 'tcx> HasMoveData<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx> {
fn move_data(&self) -> &MoveData<'tcx> { &self.mdpe.move_data } fn move_data(&self) -> &MoveData<'tcx> { &self.mdpe.move_data }
} }
@ -209,13 +209,13 @@ impl<'a, 'tcx: 'a> HasMoveData<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx> {
/// c = S; // {a, b, c, d } /// c = S; // {a, b, c, d }
/// } /// }
/// ``` /// ```
pub struct EverInitializedPlaces<'a, 'tcx: 'a> { pub struct EverInitializedPlaces<'a, 'tcx> {
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
mdpe: &'a MoveDataParamEnv<'tcx>, mdpe: &'a MoveDataParamEnv<'tcx>,
} }
impl<'a, 'tcx: 'a> EverInitializedPlaces<'a, 'tcx> { impl<'a, 'tcx> EverInitializedPlaces<'a, 'tcx> {
pub fn new(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, mdpe: &'a MoveDataParamEnv<'tcx>) -> Self { pub fn new(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, mdpe: &'a MoveDataParamEnv<'tcx>) -> Self {
EverInitializedPlaces { tcx: tcx, body: body, mdpe: mdpe } EverInitializedPlaces { tcx: tcx, body: body, mdpe: mdpe }
} }

View file

@ -4,11 +4,11 @@ use rustc::mir::*;
use crate::dataflow::BitDenotation; use crate::dataflow::BitDenotation;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct MaybeStorageLive<'a, 'tcx: 'a> { pub struct MaybeStorageLive<'a, 'tcx> {
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
} }
impl<'a, 'tcx: 'a> MaybeStorageLive<'a, 'tcx> { impl<'a, 'tcx> MaybeStorageLive<'a, 'tcx> {
pub fn new(body: &'a Body<'tcx>) pub fn new(body: &'a Body<'tcx>)
-> Self { -> Self {
MaybeStorageLive { body } MaybeStorageLive { body }

View file

@ -41,7 +41,7 @@ pub(crate) mod indexes {
}; };
} }
pub(crate) struct DataflowBuilder<'a, 'tcx: 'a, BD> pub(crate) struct DataflowBuilder<'a, 'tcx, BD>
where where
BD: BitDenotation<'tcx> BD: BitDenotation<'tcx>
{ {
@ -86,7 +86,7 @@ pub(crate) trait Dataflow<'tcx, BD: BitDenotation<'tcx>> {
fn propagate(&mut self); fn propagate(&mut self);
} }
impl<'a, 'tcx: 'a, BD> Dataflow<'tcx, BD> for DataflowBuilder<'a, 'tcx, BD> impl<'a, 'tcx, BD> Dataflow<'tcx, BD> for DataflowBuilder<'a, 'tcx, BD>
where where
BD: BitDenotation<'tcx> BD: BitDenotation<'tcx>
{ {
@ -138,7 +138,7 @@ where
flow_state.run(tcx, def_id, attributes, p) flow_state.run(tcx, def_id, attributes, p)
} }
impl<'a, 'tcx: 'a, BD> DataflowAnalysis<'a, 'tcx, BD> impl<'a, 'tcx, BD> DataflowAnalysis<'a, 'tcx, BD>
where where
BD: BitDenotation<'tcx>, BD: BitDenotation<'tcx>,
{ {
@ -179,12 +179,12 @@ where
} }
} }
struct PropagationContext<'b, 'a: 'b, 'tcx: 'a, O> where O: 'b + BitDenotation<'tcx> struct PropagationContext<'b, 'a, 'tcx, O> where O: 'b + BitDenotation<'tcx>
{ {
builder: &'b mut DataflowAnalysis<'a, 'tcx, O>, builder: &'b mut DataflowAnalysis<'a, 'tcx, O>,
} }
impl<'a, 'tcx: 'a, BD> DataflowAnalysis<'a, 'tcx, BD> where BD: BitDenotation<'tcx> impl<'a, 'tcx, BD> DataflowAnalysis<'a, 'tcx, BD> where BD: BitDenotation<'tcx>
{ {
fn propagate(&mut self) { fn propagate(&mut self) {
let mut temp = BitSet::new_empty(self.flow_state.sets.bits_per_block); let mut temp = BitSet::new_empty(self.flow_state.sets.bits_per_block);
@ -234,7 +234,7 @@ impl<'a, 'tcx: 'a, BD> DataflowAnalysis<'a, 'tcx, BD> where BD: BitDenotation<'t
} }
} }
impl<'b, 'a: 'b, 'tcx: 'a, BD> PropagationContext<'b, 'a, 'tcx, BD> where BD: BitDenotation<'tcx> impl<'b, 'a, 'tcx, BD> PropagationContext<'b, 'a, 'tcx, BD> where BD: BitDenotation<'tcx>
{ {
fn walk_cfg(&mut self, in_out: &mut BitSet<BD::Idx>) { fn walk_cfg(&mut self, in_out: &mut BitSet<BD::Idx>) {
let mut dirty_queue: WorkQueue<mir::BasicBlock> = let mut dirty_queue: WorkQueue<mir::BasicBlock> =
@ -265,7 +265,7 @@ fn dataflow_path(context: &str, path: &str) -> PathBuf {
path path
} }
impl<'a, 'tcx: 'a, BD> DataflowBuilder<'a, 'tcx, BD> where BD: BitDenotation<'tcx> impl<'a, 'tcx, BD> DataflowBuilder<'a, 'tcx, BD> where BD: BitDenotation<'tcx>
{ {
fn pre_dataflow_instrumentation<P>(&self, p: P) -> io::Result<()> fn pre_dataflow_instrumentation<P>(&self, p: P) -> io::Result<()>
where P: Fn(&BD, BD::Idx) -> DebugFormatted where P: Fn(&BD, BD::Idx) -> DebugFormatted
@ -297,7 +297,7 @@ impl<'a, 'tcx: 'a, BD> DataflowBuilder<'a, 'tcx, BD> where BD: BitDenotation<'tc
/// underlying flow analysis results, because it needs to handle cases /// underlying flow analysis results, because it needs to handle cases
/// where we are combining the results of *multiple* flow analyses /// where we are combining the results of *multiple* flow analyses
/// (e.g., borrows + inits + uninits). /// (e.g., borrows + inits + uninits).
pub(crate) trait DataflowResultsConsumer<'a, 'tcx: 'a> { pub(crate) trait DataflowResultsConsumer<'a, 'tcx> {
type FlowState: FlowsAtLocation; type FlowState: FlowsAtLocation;
// Observation Hooks: override (at least one of) these to get analysis feedback. // Observation Hooks: override (at least one of) these to get analysis feedback.
@ -387,14 +387,14 @@ pub fn state_for_location<'tcx, T: BitDenotation<'tcx>>(loc: Location,
gen_set.to_dense() gen_set.to_dense()
} }
pub struct DataflowAnalysis<'a, 'tcx: 'a, O> where O: BitDenotation<'tcx> pub struct DataflowAnalysis<'a, 'tcx, O> where O: BitDenotation<'tcx>
{ {
flow_state: DataflowState<'tcx, O>, flow_state: DataflowState<'tcx, O>,
dead_unwinds: &'a BitSet<mir::BasicBlock>, dead_unwinds: &'a BitSet<mir::BasicBlock>,
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
} }
impl<'a, 'tcx: 'a, O> DataflowAnalysis<'a, 'tcx, O> where O: BitDenotation<'tcx> impl<'a, 'tcx, O> DataflowAnalysis<'a, 'tcx, O> where O: BitDenotation<'tcx>
{ {
pub fn results(self) -> DataflowResults<'tcx, O> { pub fn results(self) -> DataflowResults<'tcx, O> {
DataflowResults(self.flow_state) DataflowResults(self.flow_state)
@ -734,7 +734,7 @@ impl<'a, 'tcx, D> DataflowAnalysis<'a, 'tcx, D> where D: BitDenotation<'tcx>
} }
} }
impl<'a, 'tcx: 'a, D> DataflowAnalysis<'a, 'tcx, D> where D: BitDenotation<'tcx> { impl<'a, 'tcx, D> DataflowAnalysis<'a, 'tcx, D> where D: BitDenotation<'tcx> {
/// Propagates the bits of `in_out` into all the successors of `bb`, /// Propagates the bits of `in_out` into all the successors of `bb`,
/// using bitwise operator denoted by `self.operator`. /// using bitwise operator denoted by `self.operator`.
/// ///

View file

@ -12,7 +12,7 @@ use super::{LocationMap, MoveData, MovePath, MovePathLookup, MovePathIndex, Move
use super::{MoveError, InitIndex, Init, InitLocation, LookupResult, InitKind}; use super::{MoveError, InitIndex, Init, InitLocation, LookupResult, InitKind};
use super::IllegalMoveOriginKind::*; use super::IllegalMoveOriginKind::*;
struct MoveDataBuilder<'a, 'tcx: 'a> { struct MoveDataBuilder<'a, 'tcx> {
body: &'a Body<'tcx>, body: &'a Body<'tcx>,
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
data: MoveData<'tcx>, data: MoveData<'tcx>,
@ -253,7 +253,7 @@ impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
} }
} }
struct Gatherer<'b, 'a: 'b, 'tcx: 'a> { struct Gatherer<'b, 'a, 'tcx> {
builder: &'b mut MoveDataBuilder<'a, 'tcx>, builder: &'b mut MoveDataBuilder<'a, 'tcx>,
loc: Location, loc: Location,
} }

Some files were not shown because too many files have changed in this diff Show more