From 1784634a39be33b71b9118f8900fd0377e2c75c0 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 22 May 2022 12:48:19 -0700 Subject: Lifetime variance fixes for rustc --- compiler/rustc_mir_transform/src/coverage/graph.rs | 25 +++++++--------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'compiler/rustc_mir_transform/src/coverage') diff --git a/compiler/rustc_mir_transform/src/coverage/graph.rs b/compiler/rustc_mir_transform/src/coverage/graph.rs index 47190fa0d1a..510f1e64ed1 100644 --- a/compiler/rustc_mir_transform/src/coverage/graph.rs +++ b/compiler/rustc_mir_transform/src/coverage/graph.rs @@ -481,8 +481,8 @@ impl std::fmt::Debug for BcbBranch { // FIXME(#78544): MIR InstrumentCoverage: Improve coverage of `#[should_panic]` tests and // `catch_unwind()` handlers. fn bcb_filtered_successors<'a, 'tcx>( - body: &'tcx &'a mir::Body<'tcx>, - term_kind: &'tcx TerminatorKind<'tcx>, + body: &'a mir::Body<'tcx>, + term_kind: &'a TerminatorKind<'tcx>, ) -> Box + 'a> { Box::new( match &term_kind { @@ -691,12 +691,9 @@ pub(super) fn find_loop_backedges( pub struct ShortCircuitPreorder< 'a, 'tcx, - F: Fn( - &'tcx &'a mir::Body<'tcx>, - &'tcx TerminatorKind<'tcx>, - ) -> Box + 'a>, + F: Fn(&'a mir::Body<'tcx>, &'a TerminatorKind<'tcx>) -> Box + 'a>, > { - body: &'tcx &'a mir::Body<'tcx>, + body: &'a mir::Body<'tcx>, visited: BitSet, worklist: Vec, filtered_successors: F, @@ -705,14 +702,11 @@ pub struct ShortCircuitPreorder< impl< 'a, 'tcx, - F: Fn( - &'tcx &'a mir::Body<'tcx>, - &'tcx TerminatorKind<'tcx>, - ) -> Box + 'a>, + F: Fn(&'a mir::Body<'tcx>, &'a TerminatorKind<'tcx>) -> Box + 'a>, > ShortCircuitPreorder<'a, 'tcx, F> { pub fn new( - body: &'tcx &'a mir::Body<'tcx>, + body: &'a mir::Body<'tcx>, filtered_successors: F, ) -> ShortCircuitPreorder<'a, 'tcx, F> { let worklist = vec![mir::START_BLOCK]; @@ -727,12 +721,9 @@ impl< } impl< - 'a: 'tcx, + 'a, 'tcx, - F: Fn( - &'tcx &'a mir::Body<'tcx>, - &'tcx TerminatorKind<'tcx>, - ) -> Box + 'a>, + F: Fn(&'a mir::Body<'tcx>, &'a TerminatorKind<'tcx>) -> Box + 'a>, > Iterator for ShortCircuitPreorder<'a, 'tcx, F> { type Item = (BasicBlock, &'a BasicBlockData<'tcx>); -- cgit 1.4.1-3-g733a5