Skip to content

Commit d110d30

Browse files
committed
rustc_mir: deny(unused_lifetimes).
1 parent 7dc3494 commit d110d30

File tree

13 files changed

+27
-26
lines changed

13 files changed

+27
-26
lines changed

src/librustc_mir/borrow_check/nll/invalidation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl<'cx, 'tcx, 'gcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx, 'gcx> {
258258
}
259259
}
260260

261-
impl<'cg, 'cx, 'tcx, 'gcx> InvalidationGenerator<'cx, 'tcx, 'gcx> {
261+
impl<'cx, 'tcx, 'gcx> InvalidationGenerator<'cx, 'tcx, 'gcx> {
262262
/// Simulates mutation of a place.
263263
fn mutate_place(
264264
&mut self,

src/librustc_mir/borrow_check/path_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_data_structures::graph::dominators::Dominators;
1010
/// Returns `true` if the borrow represented by `kind` is
1111
/// allowed to be split into separate Reservation and
1212
/// Activation phases.
13-
pub(super) fn allow_two_phase_borrow<'a, 'tcx, 'gcx: 'tcx>(kind: BorrowKind) -> bool {
13+
pub(super) fn allow_two_phase_borrow(kind: BorrowKind) -> bool {
1414
kind.allows_two_phase_borrow()
1515
}
1616

src/librustc_mir/build/matches/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
15751575

15761576
/// Append `AscribeUserType` statements onto the end of `block`
15771577
/// for each ascription
1578-
fn ascribe_types<'pat>(
1578+
fn ascribe_types(
15791579
&mut self,
15801580
block: BasicBlock,
15811581
ascriptions: &[Ascription<'tcx>],

src/librustc_mir/build/matches/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
463463
/// that it *doesn't* apply. For now, we return false, indicate that the
464464
/// test does not apply to this candidate, but it might be we can get
465465
/// tighter match code if we do something a bit different.
466-
pub fn sort_candidate<'pat, 'cand>(
466+
pub fn sort_candidate<'pat>(
467467
&mut self,
468468
test_place: &Place<'tcx>,
469469
test: &Test<'tcx>,

src/librustc_mir/interpret/snapshot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ struct FrameSnapshot<'a, 'tcx: 'a> {
315315
stmt: usize,
316316
}
317317

318-
impl_stable_hash_for!(impl<'mir, 'tcx: 'mir> for struct Frame<'mir, 'tcx> {
318+
impl_stable_hash_for!(impl<> for struct Frame<'mir, 'tcx> {
319319
body,
320320
instance,
321321
span,
@@ -422,7 +422,7 @@ impl<'a, 'mir, 'tcx> Hash for InterpSnapshot<'a, 'mir, 'tcx>
422422
}
423423
}
424424

425-
impl_stable_hash_for!(impl<'tcx, 'b, 'mir> for struct InterpSnapshot<'b, 'mir, 'tcx> {
425+
impl_stable_hash_for!(impl<> for struct InterpSnapshot<'_, 'mir, 'tcx> {
426426
// Not hashing memory: Avoid hashing memory all the time during execution
427427
memory -> _,
428428
stack,

src/librustc_mir/interpret/validity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub struct RefTracking<T> {
8181
pub todo: Vec<(T, Vec<PathElem>)>,
8282
}
8383

84-
impl<'tcx, T: Copy + Eq + Hash> RefTracking<T> {
84+
impl<T: Copy + Eq + Hash> RefTracking<T> {
8585
pub fn new(op: T) -> Self {
8686
let mut ref_tracking = RefTracking {
8787
seen: FxHashSet::default(),

src/librustc_mir/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2929

3030
#![deny(rust_2018_idioms)]
3131
#![deny(internal)]
32+
#![deny(unused_lifetimes)]
3233
#![allow(explicit_outlives_requirements)]
3334

3435
#[macro_use] extern crate log;

src/librustc_mir/monomorphize/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ fn find_vtable_types_for_unsizing<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
907907
}
908908
}
909909

910-
fn create_fn_mono_item<'a, 'tcx>(instance: Instance<'tcx>) -> MonoItem<'tcx> {
910+
fn create_fn_mono_item<'tcx>(instance: Instance<'tcx>) -> MonoItem<'tcx> {
911911
debug!("create_fn_mono_item(instance={})", instance);
912912
MonoItem::Fn(instance)
913913
}

src/librustc_mir/transform/check_unsafety.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub struct UnsafetyChecker<'a, 'tcx: 'a> {
3232
inherited_blocks: Vec<(hir::HirId, bool)>,
3333
}
3434

35-
impl<'a, 'gcx, 'tcx> UnsafetyChecker<'a, 'tcx> {
35+
impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
3636
fn new(
3737
const_context: bool,
3838
min_const_fn: bool,

src/librustc_mir/transform/generator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,14 +829,14 @@ fn create_generator_resume_function<'a, 'tcx>(
829829
dump_mir(tcx, None, "generator_resume", &0, source, body, |_, _| Ok(()) );
830830
}
831831

832-
fn source_info<'a, 'tcx>(body: &Body<'tcx>) -> SourceInfo {
832+
fn source_info<'tcx>(body: &Body<'tcx>) -> SourceInfo {
833833
SourceInfo {
834834
span: body.span,
835835
scope: OUTERMOST_SOURCE_SCOPE,
836836
}
837837
}
838838

839-
fn insert_clean_drop<'a, 'tcx>(body: &mut Body<'tcx>) -> BasicBlock {
839+
fn insert_clean_drop<'tcx>(body: &mut Body<'tcx>) -> BasicBlock {
840840
let return_block = insert_term_block(body, TerminatorKind::Return);
841841

842842
// Create a block to destroy an unresumed generators. This can only destroy upvars.

0 commit comments

Comments
 (0)