diff options
| -rw-r--r-- | src/librustc/infer/lattice.rs | 2 | ||||
| -rw-r--r-- | src/librustc/traits/select.rs | 4 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/base.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/mono_item.rs | 2 | ||||
| -rw-r--r-- | src/librustc_metadata/creader.rs | 7 | ||||
| -rw-r--r-- | src/librustc_metadata/decoder.rs | 20 | ||||
| -rw-r--r-- | src/librustc_mir/borrow_check/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc_mir/build/matches/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc_mir/dataflow/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc_mir/hair/pattern/_match.rs | 5 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/visitor.rs | 2 | ||||
| -rw-r--r-- | src/librustc_mir/monomorphize/partitioning.rs | 6 | ||||
| -rw-r--r-- | src/librustc_mir/util/elaborate_drops.rs | 4 | ||||
| -rw-r--r-- | src/librustc_save_analysis/lib.rs | 4 | ||||
| -rw-r--r-- | src/librustc_typeck/collect.rs | 2 |
15 files changed, 36 insertions, 30 deletions
diff --git a/src/librustc/infer/lattice.rs b/src/librustc/infer/lattice.rs index e55ce345bd9..68cbef44076 100644 --- a/src/librustc/infer/lattice.rs +++ b/src/librustc/infer/lattice.rs @@ -41,7 +41,7 @@ pub trait LatticeDir<'f, 'tcx>: TypeRelation<'tcx> { fn relate_bound(&mut self, v: Ty<'tcx>, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, ()>; } -pub fn super_lattice_tys<'a, 'tcx, L>( +pub fn super_lattice_tys<'a, 'tcx: 'a, L>( this: &mut L, a: Ty<'tcx>, b: Ty<'tcx>, diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index 645b6f418dc..7c4742259ac 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -3788,9 +3788,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { matcher.relate(previous, current).is_ok() } - fn push_stack<'o, 's>( + fn push_stack<'o>( &mut self, - previous_stack: TraitObligationStackList<'s, 'tcx>, + previous_stack: TraitObligationStackList<'o, 'tcx>, obligation: &'o TraitObligation<'tcx>, ) -> TraitObligationStack<'o, 'tcx> { let fresh_trait_ref = obligation diff --git a/src/librustc_codegen_ssa/base.rs b/src/librustc_codegen_ssa/base.rs index a06f324d389..ba96865d23b 100644 --- a/src/librustc_codegen_ssa/base.rs +++ b/src/librustc_codegen_ssa/base.rs @@ -366,7 +366,7 @@ pub fn memcpy_ty<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( bx.memcpy(dst, dst_align, src, src_align, bx.cx().const_usize(size), flags); } -pub fn codegen_instance<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( +pub fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( cx: &'a Bx::CodegenCx, instance: Instance<'tcx>, ) { diff --git a/src/librustc_codegen_ssa/mono_item.rs b/src/librustc_codegen_ssa/mono_item.rs index 57bd2f36dd7..4446f1a3a5c 100644 --- a/src/librustc_codegen_ssa/mono_item.rs +++ b/src/librustc_codegen_ssa/mono_item.rs @@ -17,7 +17,7 @@ pub trait MonoItemExt<'a, 'tcx> { fn to_raw_string(&self) -> String; } -impl<'a, 'tcx> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> { +impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> { fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx) { debug!("BEGIN IMPLEMENTING '{} ({})' in cgu {}", self.to_string(cx.tcx(), true), diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index 4564f220253..6a01d7454be 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -289,11 +289,14 @@ impl<'a> CrateLoader<'a> { (cnum, cmeta) } - fn load_proc_macro<'b> ( + fn load_proc_macro<'b>( &mut self, locate_ctxt: &mut locator::Context<'b>, path_kind: PathKind, - ) -> Option<(LoadResult, Option<Library>)> { + ) -> Option<(LoadResult, Option<Library>)> + where + 'a: 'b, + { // Use a new locator Context so trying to load a proc macro doesn't affect the error // message we emit let mut proc_macro_locator = locate_ctxt.clone(); diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index 98cdeb69968..f78cc2f38a9 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -38,7 +38,7 @@ use log::debug; pub struct DecodeContext<'a, 'tcx> { opaque: opaque::Decoder<'a>, cdata: Option<&'a CrateMetadata>, - sess: Option<&'a Session>, + sess: Option<&'tcx Session>, tcx: Option<TyCtxt<'tcx>>, // Cache the last used source_file for translating spans as an optimization. @@ -54,10 +54,8 @@ pub struct DecodeContext<'a, 'tcx> { pub trait Metadata<'a, 'tcx>: Copy { fn raw_bytes(self) -> &'a [u8]; fn cdata(self) -> Option<&'a CrateMetadata> { None } - fn sess(self) -> Option<&'a Session> { None } - fn tcx(self) -> Option<TyCtxt<'tcx>> { - None - } + fn sess(self) -> Option<&'tcx Session> { None } + fn tcx(self) -> Option<TyCtxt<'tcx>> { None } fn decoder(self, pos: usize) -> DecodeContext<'a, 'tcx> { let tcx = self.tcx(); @@ -82,13 +80,13 @@ impl<'a, 'tcx> Metadata<'a, 'tcx> for &'a MetadataBlob { } -impl<'a, 'tcx> Metadata<'a, 'tcx> for (&'a MetadataBlob, &'a Session) { +impl<'a, 'tcx> Metadata<'a, 'tcx> for (&'a MetadataBlob, &'tcx Session) { fn raw_bytes(self) -> &'a [u8] { let (blob, _) = self; &blob.0 } - fn sess(self) -> Option<&'a Session> { + fn sess(self) -> Option<&'tcx Session> { let (_, sess) = self; Some(sess) } @@ -104,14 +102,14 @@ impl<'a, 'tcx> Metadata<'a, 'tcx> for &'a CrateMetadata { } } -impl<'a, 'tcx> Metadata<'a, 'tcx> for (&'a CrateMetadata, &'a Session) { +impl<'a, 'tcx> Metadata<'a, 'tcx> for (&'a CrateMetadata, &'tcx Session) { fn raw_bytes(self) -> &'a [u8] { self.0.raw_bytes() } fn cdata(self) -> Option<&'a CrateMetadata> { Some(self.0) } - fn sess(self) -> Option<&'a Session> { + fn sess(self) -> Option<&'tcx Session> { Some(&self.1) } } @@ -136,11 +134,11 @@ impl<'a, 'tcx, T: Decodable> Lazy<T> { } } -impl<'a, 'tcx, T: Decodable> LazySeq<T> { +impl<'a: 'x, 'tcx: 'x, 'x, T: Decodable> LazySeq<T> { pub fn decode<M: Metadata<'a, 'tcx>>( self, meta: M, - ) -> impl Iterator<Item = T> + Captures<'tcx> + 'a { + ) -> impl Iterator<Item = T> + Captures<'a> + Captures<'tcx> + 'x { let mut dcx = meta.decoder(self.position); dcx.lazy_state = LazyState::NodeStart(self.position); (0..self.len).map(move |_| T::decode(&mut dcx).unwrap()) diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index 288d69f097d..afdc9f5c02a 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -1693,7 +1693,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { fn move_path_closest_to<'a>( &mut self, place: &'a Place<'tcx>, - ) -> Result<(&'a Place<'tcx>, MovePathIndex), NoMovePathFound> { + ) -> Result<(&'a Place<'tcx>, MovePathIndex), NoMovePathFound> where 'cx: 'a { let mut last_prefix = place; for prefix in self.prefixes(place, PrefixSet::All) { if let Some(mpi) = self.move_path_for_place(prefix) { diff --git a/src/librustc_mir/build/matches/mod.rs b/src/librustc_mir/build/matches/mod.rs index aa576030ef1..55093f28a42 100644 --- a/src/librustc_mir/build/matches/mod.rs +++ b/src/librustc_mir/build/matches/mod.rs @@ -1691,7 +1691,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { &mut self, block: BasicBlock, bindings: impl IntoIterator<Item = &'b Binding<'tcx>>, - ) { + ) where 'tcx: 'b { debug!("bind_matched_candidate_for_arm_body(block={:?})", block); let re_erased = self.hir.tcx().lifetimes.re_erased; diff --git a/src/librustc_mir/dataflow/mod.rs b/src/librustc_mir/dataflow/mod.rs index 1130e7e3f5d..8f91ba23e23 100644 --- a/src/librustc_mir/dataflow/mod.rs +++ b/src/librustc_mir/dataflow/mod.rs @@ -297,7 +297,7 @@ impl<'a, 'tcx, BD> DataflowBuilder<'a, 'tcx, BD> where BD: BitDenotation<'tcx> /// underlying flow analysis results, because it needs to handle cases /// where we are combining the results of *multiple* flow analyses /// (e.g., borrows + inits + uninits). -pub(crate) trait DataflowResultsConsumer<'a, 'tcx> { +pub(crate) trait DataflowResultsConsumer<'a, 'tcx: 'a> { type FlowState: FlowsAtLocation; // Observation Hooks: override (at least one of) these to get analysis feedback. diff --git a/src/librustc_mir/hair/pattern/_match.rs b/src/librustc_mir/hair/pattern/_match.rs index e4cff5861ca..f5817694c50 100644 --- a/src/librustc_mir/hair/pattern/_match.rs +++ b/src/librustc_mir/hair/pattern/_match.rs @@ -709,7 +709,8 @@ fn all_constructors<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>, fn max_slice_length<'p, 'a, 'tcx, I>( cx: &mut MatchCheckCtxt<'a, 'tcx>, patterns: I) -> u64 - where I: Iterator<Item=&'p Pattern<'tcx>> + where I: Iterator<Item=&'p Pattern<'tcx>>, + 'tcx: 'p, { // The exhaustiveness-checking paper does not include any details on // checking variable-length slice patterns. However, they are matched @@ -1709,7 +1710,7 @@ fn patterns_for_variant<'p, 'tcx>( /// different patterns. /// Structure patterns with a partial wild pattern (Foo { a: 42, .. }) have their missing /// fields filled with wild patterns. -fn specialize<'p, 'a, 'tcx>( +fn specialize<'p, 'a: 'p, 'tcx>( cx: &mut MatchCheckCtxt<'a, 'tcx>, r: &[&'p Pattern<'tcx>], constructor: &Constructor<'tcx>, diff --git a/src/librustc_mir/interpret/visitor.rs b/src/librustc_mir/interpret/visitor.rs index 95a679b95dd..9150f16526b 100644 --- a/src/librustc_mir/interpret/visitor.rs +++ b/src/librustc_mir/interpret/visitor.rs @@ -122,7 +122,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Value<'mir, 'tcx, M> for MPlaceTy<'tcx, macro_rules! make_value_visitor { ($visitor_trait_name:ident, $($mutability:ident)?) => { // How to traverse a value and what to do when we are at the leaves. - pub trait $visitor_trait_name<'mir, 'tcx, M: Machine<'mir, 'tcx>>: Sized { + pub trait $visitor_trait_name<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>>: Sized { type V: Value<'mir, 'tcx, M>; /// The visitor must have an `InterpretCx` in it. diff --git a/src/librustc_mir/monomorphize/partitioning.rs b/src/librustc_mir/monomorphize/partitioning.rs index 0337f3f1da7..32e4d4f437a 100644 --- a/src/librustc_mir/monomorphize/partitioning.rs +++ b/src/librustc_mir/monomorphize/partitioning.rs @@ -766,9 +766,10 @@ fn numbered_codegen_unit_name( name_builder.build_cgu_name_no_mangle(LOCAL_CRATE, &["cgu"], Some(index)) } -fn debug_dump<'a, 'b, 'tcx, I>(tcx: TyCtxt<'tcx>, label: &str, cgus: I) +fn debug_dump<'a, 'tcx, I>(tcx: TyCtxt<'tcx>, label: &str, cgus: I) where - I: Iterator<Item = &'b CodegenUnit<'tcx>>, + I: Iterator<Item = &'a CodegenUnit<'tcx>>, + 'tcx: 'a, { if cfg!(debug_assertions) { debug!("{}", label); @@ -796,6 +797,7 @@ where fn assert_symbols_are_distinct<'a, 'tcx, I>(tcx: TyCtxt<'tcx>, mono_items: I) where I: Iterator<Item = &'a MonoItem<'tcx>>, + 'tcx: 'a, { let mut symbols: Vec<_> = mono_items.map(|mono_item| { (mono_item, mono_item.symbol_name(tcx)) diff --git a/src/librustc_mir/util/elaborate_drops.rs b/src/librustc_mir/util/elaborate_drops.rs index 6da181ef668..002ff4b0b08 100644 --- a/src/librustc_mir/util/elaborate_drops.rs +++ b/src/librustc_mir/util/elaborate_drops.rs @@ -111,7 +111,8 @@ pub fn elaborate_drop<'b, 'tcx, D>( succ: BasicBlock, unwind: Unwind, bb: BasicBlock) - where D: DropElaborator<'b, 'tcx> + where D: DropElaborator<'b, 'tcx>, + 'tcx: 'b, { DropCtxt { elaborator, source_info, place, path, succ, unwind @@ -121,6 +122,7 @@ pub fn elaborate_drop<'b, 'tcx, D>( impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> where D: DropElaborator<'b, 'tcx>, + 'tcx: 'b, { fn place_ty(&self, place: &Place<'tcx>) -> Ty<'tcx> { place.ty(self.elaborator.body(), self.tcx()).ty diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 4882a4240c8..bc813b3d5a2 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -960,8 +960,8 @@ impl<'l> PathCollector<'l> { } } -impl<'l, 'a> Visitor<'a> for PathCollector<'l> { - fn visit_pat(&mut self, p: &'a ast::Pat) { +impl<'l> Visitor<'l> for PathCollector<'l> { + fn visit_pat(&mut self, p: &'l ast::Pat) { match p.node { PatKind::Struct(ref path, ..) => { self.collected_paths.push((p.id, path)); diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 70deca9623b..5606d9c0ce8 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -1786,7 +1786,7 @@ fn impl_polarity<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> hir::ImplPolarity { /// the lifetimes that are declared. For fns or methods, we have to /// screen out those that do not appear in any where-clauses etc using /// `resolve_lifetime::early_bound_lifetimes`. -fn early_bound_lifetimes_from_generics<'a, 'tcx>( +fn early_bound_lifetimes_from_generics<'a, 'tcx: 'a>( tcx: TyCtxt<'tcx>, generics: &'a hir::Generics, ) -> impl Iterator<Item = &'a hir::GenericParam> + Captures<'tcx> { |
