diff options
Diffstat (limited to 'src/librustc')
46 files changed, 80 insertions, 80 deletions
diff --git a/src/librustc/cfg/construct.rs b/src/librustc/cfg/construct.rs index 85602320f0b..213e57a3b37 100644 --- a/src/librustc/cfg/construct.rs +++ b/src/librustc/cfg/construct.rs @@ -7,7 +7,7 @@ use crate::ty::{self, TyCtxt}; use crate::hir::{self, PatKind}; use crate::hir::def_id::DefId; -struct CFGBuilder<'a, 'tcx: 'a> { +struct CFGBuilder<'a, 'tcx> { tcx: TyCtxt<'tcx>, owner_def_id: DefId, tables: &'a ty::TypeckTables<'tcx>, diff --git a/src/librustc/cfg/graphviz.rs b/src/librustc/cfg/graphviz.rs index 66963e5856e..918120057d4 100644 --- a/src/librustc/cfg/graphviz.rs +++ b/src/librustc/cfg/graphviz.rs @@ -11,7 +11,7 @@ use crate::ty::TyCtxt; pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode); pub type Edge<'a> = &'a cfg::CFGEdge; -pub struct LabelledCFG<'a, 'tcx: 'a> { +pub struct LabelledCFG<'a, 'tcx> { pub tcx: TyCtxt<'tcx>, pub cfg: &'a cfg::CFG, pub name: String, diff --git a/src/librustc/dep_graph/dep_node.rs b/src/librustc/dep_graph/dep_node.rs index f7647167a75..e8f83093bda 100644 --- a/src/librustc/dep_graph/dep_node.rs +++ b/src/librustc/dep_graph/dep_node.rs @@ -207,8 +207,8 @@ macro_rules! define_dep_nodes { pub fn new<'a, 'tcx>(tcx: TyCtxt<'tcx>, dep: DepConstructor<'tcx>) -> DepNode - where 'tcx: 'a, - 'tcx: 'a + where 'tcx, + 'tcx { match dep { $( diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index 666cfc3f6dc..e29a373ec3b 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -74,7 +74,7 @@ impl<'a> FnKind<'a> { /// /// See the comments on `ItemLikeVisitor` for more details on the overall /// visit strategy. -pub enum NestedVisitorMap<'this, 'tcx: 'this> { +pub enum NestedVisitorMap<'this, 'tcx> { /// Do not visit any nested things. When you add a new /// "non-nested" thing, you will want to audit such uses to see if /// they remain valid. diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 5a548ce8d9f..153397f11b5 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -415,7 +415,7 @@ impl<'a> LoweringContext<'a> { /// needed from arbitrary locations in the crate, /// e.g., the number of lifetime generic parameters /// declared for every type and trait definition. - struct MiscCollector<'tcx, 'interner: 'tcx> { + struct MiscCollector<'tcx, 'interner> { lctx: &'tcx mut LoweringContext<'interner>, 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>, } @@ -1788,7 +1788,7 @@ impl<'a> LoweringContext<'a> { // 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. // 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>, parent: DefIndex, exist_ty_id: NodeId, @@ -1799,7 +1799,7 @@ impl<'a> LoweringContext<'a> { 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>( &'this mut self, ) -> hir::intravisit::NestedVisitorMap<'this, 'v> { diff --git a/src/librustc/hir/map/hir_id_validator.rs b/src/librustc/hir/map/hir_id_validator.rs index 32d0e069f72..60465c04ec6 100644 --- a/src/librustc/hir/map/hir_id_validator.rs +++ b/src/librustc/hir/map/hir_id_validator.rs @@ -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>, owner_def_index: Option<DefIndex>, hir_ids_seen: FxHashSet<ItemLocalId>, errors: &'a Lock<Vec<String>>, } -struct OuterVisitor<'a, 'hir: 'a> { +struct OuterVisitor<'a, 'hir> { hir_map: &'a hir::map::Map<'hir>, errors: &'a Lock<Vec<String>>, } -impl<'a, 'hir: 'a> OuterVisitor<'a, 'hir> { +impl<'a, 'hir> OuterVisitor<'a, 'hir> { fn new_inner_visitor(&self, hir_map: &'a hir::map::Map<'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) { let mut inner_visitor = self.new_inner_visitor(self.hir_map); 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] #[inline(never)] 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) -> intravisit::NestedVisitorMap<'this, 'hir> { diff --git a/src/librustc/infer/at.rs b/src/librustc/infer/at.rs index 0bb939889a8..e4aec59c1f6 100644 --- a/src/librustc/infer/at.rs +++ b/src/librustc/infer/at.rs @@ -30,13 +30,13 @@ use super::*; use crate::ty::Const; use crate::ty::relate::{Relate, TypeRelation}; -pub struct At<'a, 'tcx: 'a> { +pub struct At<'a, 'tcx> { pub infcx: &'a InferCtxt<'a, 'tcx>, pub cause: &'a ObligationCause<'tcx>, pub param_env: ty::ParamEnv<'tcx>, } -pub struct Trace<'a, 'tcx: 'a> { +pub struct Trace<'a, 'tcx> { at: At<'a, 'tcx>, a_is_expected: bool, trace: TypeTrace<'tcx>, diff --git a/src/librustc/infer/canonical/canonicalizer.rs b/src/librustc/infer/canonical/canonicalizer.rs index b4779eec65f..383048b5fe7 100644 --- a/src/librustc/infer/canonical/canonicalizer.rs +++ b/src/librustc/infer/canonical/canonicalizer.rs @@ -275,7 +275,7 @@ impl CanonicalizeRegionMode for CanonicalizeFreeRegionsOtherThanStatic { } } -struct Canonicalizer<'cx, 'tcx: 'cx> { +struct Canonicalizer<'cx, 'tcx> { infcx: Option<&'cx InferCtxt<'cx, 'tcx>>, tcx: TyCtxt<'tcx>, variables: SmallVec<[CanonicalVarInfo; 8]>, diff --git a/src/librustc/infer/combine.rs b/src/librustc/infer/combine.rs index 23550569f7c..e20b53455f4 100644 --- a/src/librustc/infer/combine.rs +++ b/src/librustc/infer/combine.rs @@ -44,7 +44,7 @@ use syntax::ast; use syntax_pos::{Span, DUMMY_SP}; #[derive(Clone)] -pub struct CombineFields<'infcx, 'tcx: 'infcx> { +pub struct CombineFields<'infcx, 'tcx> { pub infcx: &'infcx InferCtxt<'infcx, 'tcx>, pub trace: TypeTrace<'tcx>, 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>, /// The span, used when creating new type variables and things. diff --git a/src/librustc/infer/equate.rs b/src/librustc/infer/equate.rs index 39d8241e6b4..5eebe9e78d3 100644 --- a/src/librustc/infer/equate.rs +++ b/src/librustc/infer/equate.rs @@ -11,7 +11,7 @@ use crate::mir::interpret::ConstValue; use crate::infer::unify_key::replace_if_possible; /// 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>, a_is_expected: bool, } diff --git a/src/librustc/infer/error_reporting/nice_region_error/mod.rs b/src/librustc/infer/error_reporting/nice_region_error/mod.rs index 541d9a96dbe..1edb1c601bf 100644 --- a/src/librustc/infer/error_reporting/nice_region_error/mod.rs +++ b/src/librustc/infer/error_reporting/nice_region_error/mod.rs @@ -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>, error: Option<RegionResolutionError<'tcx>>, regions: Option<(Span, ty::Region<'tcx>, ty::Region<'tcx>)>, diff --git a/src/librustc/infer/freshen.rs b/src/librustc/infer/freshen.rs index 645f2b02338..7f4a817faf1 100644 --- a/src/librustc/infer/freshen.rs +++ b/src/librustc/infer/freshen.rs @@ -41,7 +41,7 @@ use std::collections::hash_map::Entry; use super::InferCtxt; use super::unify_key::ToType; -pub struct TypeFreshener<'a, 'tcx: 'a> { +pub struct TypeFreshener<'a, 'tcx> { infcx: &'a InferCtxt<'a, 'tcx>, ty_freshen_count: u32, const_freshen_count: u32, diff --git a/src/librustc/infer/fudge.rs b/src/librustc/infer/fudge.rs index 59364862c64..658a9c1d888 100644 --- a/src/librustc/infer/fudge.rs +++ b/src/librustc/infer/fudge.rs @@ -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>, type_vars: (Range<TyVid>, Vec<TypeVariableOrigin>), int_vars: Range<IntVid>, diff --git a/src/librustc/infer/glb.rs b/src/librustc/infer/glb.rs index 7f184d3424f..55021316747 100644 --- a/src/librustc/infer/glb.rs +++ b/src/librustc/infer/glb.rs @@ -8,7 +8,7 @@ use crate::ty::{self, Ty, TyCtxt}; use crate::ty::relate::{Relate, RelateResult, TypeRelation}; /// "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>, a_is_expected: bool, } diff --git a/src/librustc/infer/lattice.rs b/src/librustc/infer/lattice.rs index c7766636e04..a3372f50379 100644 --- a/src/librustc/infer/lattice.rs +++ b/src/librustc/infer/lattice.rs @@ -27,7 +27,7 @@ use crate::ty::TyVar; use crate::ty::{self, Ty}; 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 cause(&self) -> &ObligationCause<'tcx>; @@ -48,7 +48,7 @@ pub fn super_lattice_tys<'a, 'tcx, L>( ) -> RelateResult<'tcx, Ty<'tcx>> where L: LatticeDir<'a, 'tcx>, - 'tcx: 'a, + 'tcx, { debug!("{}.lattice_tys({:?}, {:?})", this.tag(), diff --git a/src/librustc/infer/lexical_region_resolve/graphviz.rs b/src/librustc/infer/lexical_region_resolve/graphviz.rs index aa4bbcad6d5..ad481417d5e 100644 --- a/src/librustc/infer/lexical_region_resolve/graphviz.rs +++ b/src/librustc/infer/lexical_region_resolve/graphviz.rs @@ -107,7 +107,7 @@ pub fn maybe_print_constraints_for<'a, 'tcx>( } } -struct ConstraintGraph<'a, 'tcx: 'a> { +struct ConstraintGraph<'a, 'tcx> { graph_name: String, region_rels: &'a RegionRelations<'a, 'tcx>, map: &'a BTreeMap<Constraint<'tcx>, SubregionOrigin<'tcx>>, diff --git a/src/librustc/infer/lexical_region_resolve/mod.rs b/src/librustc/infer/lexical_region_resolve/mod.rs index 16f5a9d3b36..2613f4c7c2a 100644 --- a/src/librustc/infer/lexical_region_resolve/mod.rs +++ b/src/librustc/infer/lexical_region_resolve/mod.rs @@ -93,7 +93,7 @@ struct RegionAndOrigin<'tcx> { type RegionGraph<'tcx> = Graph<(), Constraint<'tcx>>; -struct LexicalResolver<'cx, 'tcx: 'cx> { +struct LexicalResolver<'cx, 'tcx> { region_rels: &'cx RegionRelations<'cx, 'tcx>, var_infos: VarInfos, data: RegionConstraintData<'tcx>, diff --git a/src/librustc/infer/lub.rs b/src/librustc/infer/lub.rs index 2a9f5856eb8..156288b9e6a 100644 --- a/src/librustc/infer/lub.rs +++ b/src/librustc/infer/lub.rs @@ -8,7 +8,7 @@ use crate::ty::{self, Ty, TyCtxt}; use crate::ty::relate::{Relate, RelateResult, TypeRelation}; /// "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>, a_is_expected: bool, } diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index 47a276b2bcc..fc46fe383c9 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -585,7 +585,7 @@ impl<'tcx> InferOk<'tcx, ()> { } #[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, type_snapshot: type_variable::Snapshot<'tcx>, const_snapshot: ut::Snapshot<ut::InPlace<ty::ConstVid<'tcx>>>, diff --git a/src/librustc/infer/nll_relate/mod.rs b/src/librustc/infer/nll_relate/mod.rs index 2c821d0ae15..21489965b1b 100644 --- a/src/librustc/infer/nll_relate/mod.rs +++ b/src/librustc/infer/nll_relate/mod.rs @@ -38,7 +38,7 @@ pub enum NormalizationStrategy { Eager, } -pub struct TypeRelating<'me, 'tcx: 'me, D> +pub struct TypeRelating<'me, 'tcx, D> where D: TypeRelatingDelegate<'tcx>, { @@ -741,7 +741,7 @@ where /// binder depth, and finds late-bound regions targeting the /// `for<..`>. For each of those, it creates an entry in /// `bound_region_scope`. -struct ScopeInstantiator<'me, 'tcx: 'me> { +struct ScopeInstantiator<'me, 'tcx> { next_region: &'me mut dyn FnMut(ty::BoundRegion) -> ty::Region<'tcx>, // The debruijn index of the scope we are instantiating. target_index: ty::DebruijnIndex, @@ -798,7 +798,7 @@ impl<'me, 'tcx> TypeVisitor<'tcx> for ScopeInstantiator<'me, 'tcx> { /// scopes. /// /// [blog post]: https://is.gd/0hKvIr -struct TypeGeneralizer<'me, 'tcx: 'me, D> +struct TypeGeneralizer<'me, 'tcx, D> where D: TypeRelatingDelegate<'tcx> + 'me, { diff --git a/src/librustc/infer/opaque_types/mod.rs b/src/librustc/infer/opaque_types/mod.rs index 328ace51a58..c164f5446fd 100644 --- a/src/librustc/infer/opaque_types/mod.rs +++ b/src/librustc/infer/opaque_types/mod.rs @@ -723,7 +723,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> { } } -struct Instantiator<'a, 'tcx: 'a> { +struct Instantiator<'a, 'tcx> { infcx: &'a InferCtxt<'a, 'tcx>, parent_def_id: DefId, body_id: hir::HirId, diff --git a/src/librustc/infer/outlives/env.rs b/src/librustc/infer/outlives/env.rs index 4b5df444148..d5558861285 100644 --- a/src/librustc/infer/outlives/env.rs +++ b/src/librustc/infer/outlives/env.rs @@ -67,7 +67,7 @@ pub struct OutlivesEnvironment<'tcx> { /// because of implied bounds. 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 { let mut env = OutlivesEnvironment { param_env, diff --git a/src/librustc/infer/outlives/obligations.rs b/src/librustc/infer/outlives/obligations.rs index 671718b1008..0ae4446ee63 100644 --- a/src/librustc/infer/outlives/obligations.rs +++ b/src/librustc/infer/outlives/obligations.rs @@ -226,7 +226,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> { /// via a "delegate" of type `D` -- this is usually the `infcx`, which /// accrues them into the `region_obligations` code, but for NLL we /// use something else. -pub struct TypeOutlives<'cx, 'tcx: 'cx, D> +pub struct TypeOutlives<'cx, 'tcx, D> where D: TypeOutlivesDelegate<'tcx>, { diff --git a/src/librustc/infer/outlives/verify.rs b/src/librustc/infer/outlives/verify.rs index 96335e1052e..f23e52fcfe4 100644 --- a/src/librustc/infer/outlives/verify.rs +++ b/src/librustc/infer/outlives/verify.rs @@ -12,7 +12,7 @@ use crate::util::captures::Captures; /// via a "delegate" of type `D` -- this is usually the `infcx`, which /// accrues them into the `region_obligations` code, but for NLL we /// use something else. -pub struct VerifyBoundCx<'cx, 'tcx: 'cx> { +pub struct VerifyBoundCx<'cx, 'tcx> { tcx: TyCtxt<'tcx>, region_bound_pairs: &'cx RegionBoundPairs<'tcx>, implicit_region_bound: Option<ty::Region<'tcx>>, diff --git a/src/librustc/infer/resolve.rs b/src/librustc/infer/resolve.rs index 810c64185a7..7e553d7666b 100644 --- a/src/librustc/infer/resolve.rs +++ b/src/librustc/infer/resolve.rs @@ -12,7 +12,7 @@ use crate::ty::fold::{TypeFolder, TypeVisitor}; /// been unified with (similar to `shallow_resolve`, but deep). This is /// useful for printing messages etc but also required at various /// points for correctness. -pub struct OpportunisticVarResolver<'a, 'tcx: 'a> { +pub struct OpportunisticVarResolver<'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 /// opportunistic type resolver, but also opportunistically resolves /// regions. It is useful for canonicalization. -pub struct OpportunisticTypeAndRegionResolver<'a, 'tcx: 'a> { +pub struct OpportunisticTypeAndRegionResolver<'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. /// It does not construct the fully resolved type (which might /// involve some hashing and so forth). -pub struct UnresolvedTypeFinder<'a, 'tcx: 'a> { +pub struct UnresolvedTypeFinder<'a, 'tcx> { infcx: &'a InferCtxt<'a, 'tcx>, /// 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 // `err` field is not enforcable otherwise. -struct FullTypeResolver<'a, 'tcx: 'a> { +struct FullTypeResolver<'a, 'tcx> { infcx: &'a InferCtxt<'a, 'tcx>, err: Option<FixupError<'tcx>>, } diff --git a/src/librustc/infer/sub.rs b/src/librustc/infer/sub.rs index ed84e3f63ae..1452a6dee5b 100644 --- a/src/librustc/infer/sub.rs +++ b/src/librustc/infer/sub.rs @@ -11,7 +11,7 @@ use crate::mir::interpret::ConstValue; use std::mem; /// 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>, a_is_expected: bool, } diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index e90f4ca94c6..7f09120bbdd 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -507,7 +507,7 @@ impl LintStore { } /// Context for lint checking after type checking. -pub struct LateContext<'a, 'tcx: 'a> { +pub struct LateContext<'a, 'tcx> { /// Type context we're checking in. pub tcx: TyCtxt<'tcx>, @@ -533,7 +533,7 @@ pub struct LateContext<'a, 'tcx: 'a> { 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>, pass: T, } diff --git a/src/librustc/middle/dead.rs b/src/librustc/middle/dead.rs index 63503f58156..9e2038fa89e 100644 --- a/src/librustc/middle/dead.rs +++ b/src/librustc/middle/dead.rs @@ -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>, tcx: TyCtxt<'tcx>, tables: &'a ty::TypeckTables<'tcx>, @@ -351,7 +351,7 @@ fn has_allow_dead_code_or_lang_attr( // or // 2) We are not sure to be live or not // * Implementation of a trait method -struct LifeSeeder<'k, 'tcx: 'k> { +struct LifeSeeder<'k, 'tcx> { worklist: Vec<hir::HirId>, krate: &'k hir::Crate, tcx: TyCtxt<'tcx>, diff --git a/src/librustc/middle/entry.rs b/src/librustc/middle/entry.rs index d9e7caebb98..d1867e8fa36 100644 --- a/src/librustc/middle/entry.rs +++ b/src/librustc/middle/entry.rs @@ -11,7 +11,7 @@ use crate::hir::itemlikevisit::ItemLikeVisitor; use crate::ty::TyCtxt; use crate::ty::query::Providers; -struct EntryContext<'a, 'tcx: 'a> { +struct EntryContext<'a, 'tcx> { session: &'a Session, map: &'a hir_map::Map<'tcx>, diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index 61770e6f487..1c3eead90fa 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -229,7 +229,7 @@ impl OverloadedCallType { // The ExprUseVisitor type // // 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>, delegate: &'a mut dyn Delegate<'tcx>, param_env: ty::ParamEnv<'tcx>, diff --git a/src/librustc/middle/free_region.rs b/src/librustc/middle/free_region.rs index a8a7df08469..60e41f7eb0f 100644 --- a/src/librustc/middle/free_region.rs +++ b/src/librustc/middle/free_region.rs @@ -15,7 +15,7 @@ use crate::ty::{self, TyCtxt, Region}; /// /// This stuff is a bit convoluted and should be refactored, but as we /// transition to NLL, it'll all go away anyhow. -pub struct RegionRelations<'a, 'tcx: 'a> { +pub struct RegionRelations<'a, 'tcx> { pub tcx: TyCtxt<'tcx>, /// The context used to fetch the region maps. diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 3d2bc6c7bf8..36411f81f1a 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -352,7 +352,7 @@ impl IrMaps<'tcx> { } } -fn visit_fn<'a, 'tcx: 'a>( +fn visit_fn<'a, 'tcx>( ir: &mut IrMaps<'tcx>, fk: FnKind<'tcx>, decl: &'tcx hir::FnDecl, @@ -682,7 +682,7 @@ const ACC_READ: u32 = 1; const ACC_WRITE: u32 = 2; const ACC_USE: u32 = 4; -struct Liveness<'a, 'tcx: 'a> { +struct Liveness<'a, 'tcx> { ir: &'a mut IrMaps<'tcx>, tables: &'a ty::TypeckTables<'tcx>, s: Specials, diff --git a/src/librustc/middle/reachable.rs b/src/librustc/middle/reachable.rs index 628a44cbfe0..593c5e73421 100644 --- a/src/librustc/middle/reachable.rs +++ b/src/librustc/middle/reachable.rs @@ -65,7 +65,7 @@ fn method_might_be_inlined<'tcx>( } // Information needed while computing reachability. -struct ReachableContext<'a, 'tcx: 'a> { +struct ReachableContext<'a, 'tcx> { // The type context. tcx: TyCtxt<'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 // trait items are used from inlinable code through method call syntax or UFCS, or their // trait is a lang item. -struct CollectPrivateImplItemsVisitor<'a, 'tcx: 'a> { +struct CollectPrivateImplItemsVisitor<'a, 'tcx> { tcx: TyCtxt<'tcx>, access_levels: &'a privacy::AccessLevels, 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) { // Anything which has custom linkage gets thrown on the worklist no // matter where it is in the crate, along with "special std symbols" diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 76bff500634..f68e18c2bb8 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -217,7 +217,7 @@ impl_stable_hash_for!(struct crate::middle::resolve_lifetime::ResolveLifetimes { object_lifetime_defaults }); -struct LifetimeContext<'a, 'tcx: 'a> { +struct LifetimeContext<'a, 'tcx> { tcx: TyCtxt<'tcx>, map: &'a mut NamedRegionMap, 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 // if one of the label shadows a lifetime or another label. fn extract_labels(ctxt: &mut LifetimeContext<'_, '_>, body: &hir::Body) { - struct GatherLabels<'a, 'tcx: 'a> { + struct GatherLabels<'a, 'tcx> { tcx: TyCtxt<'tcx>, scope: ScopeRef<'a>, labels_in_fn: &'a mut Vec<ast::Ident>, diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index 19d127a565f..5a1e5212f86 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -105,7 +105,7 @@ impl_stable_hash_for!(struct self::Index<'tcx> { }); // A private tree-walker for producing an Index. -struct Annotator<'a, 'tcx: 'a> { +struct Annotator<'a, 'tcx> { tcx: TyCtxt<'tcx>, index: &'a mut Index<'tcx>, parent_stab: Option<&'tcx Stability>, @@ -113,7 +113,7 @@ struct Annotator<'a, 'tcx: 'a> { 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 // stability. The stability is recorded in the index and used as the parent. 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>, 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) { let stab = self.tcx.stability().local_stability(hir_id); let is_error = !self.tcx.sess.opts.test && diff --git a/src/librustc/middle/weak_lang_items.rs b/src/librustc/middle/weak_lang_items.rs index 422ff3f2fd3..b6cd24c291a 100644 --- a/src/librustc/middle/weak_lang_items.rs +++ b/src/librustc/middle/weak_lang_items.rs @@ -17,7 +17,7 @@ use crate::ty::TyCtxt; macro_rules! weak_lang_items { ($($name:ident, $item:ident, $sym:ident;)*) => ( -struct Context<'a, 'tcx: 'a> { +struct Context<'a, 'tcx> { tcx: TyCtxt<'tcx>, items: &'a mut lang_items::LanguageItems, } diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 1d5c1cb927d..9dfd8d959a3 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -2104,7 +2104,7 @@ impl<'tcx> Place<'tcx> { /// N.B., this particular impl strategy is not the most obvious. It was /// chosen because it makes a measurable difference to NLL /// performance, as this code (`borrow_conflicts_with_place`) is somewhat hot. -pub enum Projections<'p, 'tcx: 'p> { +pub enum Projections<'p, 'tcx> { Empty, 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 /// manually invokes `next`. This is because we (sometimes) want to /// 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>, } diff --git a/src/librustc/mir/traversal.rs b/src/librustc/mir/traversal.rs index 77af0e6661b..1416a5f0a6e 100644 --- a/src/librustc/mir/traversal.rs +++ b/src/librustc/mir/traversal.rs @@ -20,7 +20,7 @@ use super::*; /// /// A preorder traversal of this graph is either `A B D C` or `A C D B` #[derive(Clone)] -pub struct Preorder<'a, 'tcx: 'a> { +pub struct Preorder<'a, 'tcx> { body: &'a Body<'tcx>, visited: BitSet<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` -pub struct Postorder<'a, 'tcx: 'a> { +pub struct Postorder<'a, 'tcx> { body: &'a Body<'tcx>, visited: BitSet<BasicBlock>, 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 /// to re-use the traversal #[derive(Clone)] -pub struct ReversePostorder<'a, 'tcx: 'a> { +pub struct ReversePostorder<'a, 'tcx> { body: &'a Body<'tcx>, blocks: Vec<BasicBlock>, idx: usize diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index dcf69fee0e1..4b65d3b9d8e 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -1449,7 +1449,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { param_env: ty::ParamEnv<'tcx>, pred: ty::PolyTraitRef<'tcx>, ) -> bool { - struct ParamToVarFolder<'a, 'tcx: 'a> { + struct ParamToVarFolder<'a, 'tcx> { infcx: &'a InferCtxt<'a, 'tcx>, var_map: FxHashMap<Ty<'tcx>, Ty<'tcx>>, } diff --git a/src/librustc/traits/fulfill.rs b/src/librustc/traits/fulfill.rs index 5e2c949c7d8..f106458c767 100644 --- a/src/librustc/traits/fulfill.rs +++ b/src/librustc/traits/fulfill.rs @@ -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>, register_region_obligations: bool, } diff --git a/src/librustc/traits/project.rs b/src/librustc/traits/project.rs index d189bb23116..04364cd6311 100644 --- a/src/librustc/traits/project.rs +++ b/src/librustc/traits/project.rs @@ -285,7 +285,7 @@ where } } -struct AssocTypeNormalizer<'a, 'b: 'a, 'tcx: 'b> { +struct AssocTypeNormalizer<'a, 'b, 'tcx> { selcx: &'a mut SelectionContext<'b, 'tcx>, param_env: ty::ParamEnv<'tcx>, cause: ObligationCause<'tcx>, diff --git a/src/librustc/traits/query/normalize.rs b/src/librustc/traits/query/normalize.rs index 50476721e82..a45213b06d3 100644 --- a/src/librustc/traits/query/normalize.rs +++ b/src/librustc/traits/query/normalize.rs @@ -73,7 +73,7 @@ pub struct NormalizationResult<'tcx> { pub normalized_ty: Ty<'tcx>, } -struct QueryNormalizer<'cx, 'tcx: 'cx> { +struct QueryNormalizer<'cx, 'tcx> { infcx: &'cx InferCtxt<'cx, 'tcx>, cause: &'cx ObligationCause<'tcx>, param_env: ty::ParamEnv<'tcx>, diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index 5aa7a120957..c698b0c2933 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -50,7 +50,7 @@ use std::iter; use std::rc::Rc; use crate::util::nodemap::{FxHashMap, FxHashSet}; -pub struct SelectionContext<'cx, 'tcx: 'cx> { +pub struct SelectionContext<'cx, 'tcx> { infcx: &'cx InferCtxt<'cx, 'tcx>, /// Freshener used specifically for entries on the obligation @@ -144,7 +144,7 @@ impl IntercrateAmbiguityCause { } // A stack that walks back up the stack frame. -struct TraitObligationStack<'prev, 'tcx: 'prev> { +struct TraitObligationStack<'prev, 'tcx> { obligation: &'prev TraitObligation<'tcx>, /// Trait ref from `obligation` but "freshened" with the @@ -697,7 +697,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ) -> Result<EvaluationResult, OverflowError> where I: IntoIterator<Item = PredicateObligation<'tcx>>, - 'tcx: 'a, + 'tcx, { let mut result = EvaluatedToOk; for obligation in predicates { @@ -3789,7 +3789,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { matcher.relate(previous, current).is_ok() } - fn push_stack<'o, 's: 'o>( + fn push_stack<'o, 's>( &mut self, previous_stack: TraitObligationStackList<'s, 'tcx>, obligation: &'o TraitObligation<'tcx>, @@ -4252,7 +4252,7 @@ impl<'tcx> ProvisionalEvaluationCache<'tcx> { } #[derive(Copy, Clone)] -struct TraitObligationStackList<'o, 'tcx: 'o> { +struct TraitObligationStackList<'o, 'tcx> { cache: &'o ProvisionalEvaluationCache<'tcx>, head: Option<&'o TraitObligationStack<'o, 'tcx>>, } diff --git a/src/librustc/ty/query/on_disk_cache.rs b/src/librustc/ty/query/on_disk_cache.rs index 6f83991a2da..5781f40b93a 100644 --- a/src/librustc/ty/query/on_disk_cache.rs +++ b/src/librustc/ty/query/on_disk_cache.rs @@ -511,7 +511,7 @@ fn decode_tagged<'a, 'tcx, D, T, V>(decoder: &mut D, where T: Decodable + Eq + ::std::fmt::Debug, V: Decodable, D: DecoderWithPosition, - 'tcx: 'a, + 'tcx, { let start_pos = decoder.position(); diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs index 48e68167f82..0f158d2982a 100644 --- a/src/librustc/ty/query/plumbing.rs +++ b/src/librustc/ty/query/plumbing.rs @@ -89,7 +89,7 @@ macro_rules! profq_query_msg { /// A type representing the responsibility to execute the job in the `job` field. /// 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>>, key: Q::Key, job: Lrc<QueryJob<'tcx>>, @@ -230,7 +230,7 @@ pub struct CycleError<'tcx> { } /// 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. NotYetStarted(JobOwner<'a, 'tcx, D>), diff --git a/src/librustc/ty/wf.rs b/src/librustc/ty/wf.rs index 6b2f00e5f70..1979b4317a7 100644 --- a/src/librustc/ty/wf.rs +++ b/src/librustc/ty/wf.rs @@ -101,7 +101,7 @@ pub fn predicate_obligations<'a, 'tcx>( wf.normalize() } -struct WfPredicates<'a, 'tcx: 'a> { +struct WfPredicates<'a, 'tcx> { infcx: &'a InferCtxt<'a, 'tcx>, param_env: ty::ParamEnv<'tcx>, body_id: hir::HirId,  | 
