Skip to content

Commit b1a79df

Browse files
Actually use precise capturing in favor of outlives
1 parent 1ce4ecd commit b1a79df

File tree

9 files changed

+13
-9
lines changed

9 files changed

+13
-9
lines changed

compiler/rustc_borrowck/src/borrow_set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<'tcx> BorrowSet<'tcx> {
160160
self.location_map.len()
161161
}
162162

163-
pub(crate) fn indices(&self) -> impl Iterator<Item = BorrowIndex> + 'static {
163+
pub(crate) fn indices(&self) -> impl Iterator<Item = BorrowIndex> + use<> {
164164
BorrowIndex::ZERO..BorrowIndex::from_usize(self.len())
165165
}
166166

compiler/rustc_borrowck/src/universal_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl<'tcx> UniversalRegions<'tcx> {
312312

313313
/// Returns an iterator over all the RegionVids corresponding to
314314
/// universally quantified free regions.
315-
pub(crate) fn universal_regions(&self) -> impl Iterator<Item = RegionVid> + 'static {
315+
pub(crate) fn universal_regions(&self) -> impl Iterator<Item = RegionVid> + use<> {
316316
(FIRST_GLOBAL_INDEX..self.num_universals).map(RegionVid::from_usize)
317317
}
318318

compiler/rustc_codegen_ssa/src/mir/locals.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ impl<'tcx, V> Locals<'tcx, V> {
3232
Locals { values: IndexVec::default() }
3333
}
3434

35-
pub(super) fn indices(&self) -> impl DoubleEndedIterator<Item = mir::Local> + Clone + 'static {
35+
pub(super) fn indices(
36+
&self,
37+
) -> impl DoubleEndedIterator<Item = mir::Local> + Clone + use<'tcx, V> {
3638
self.values.indices()
3739
}
3840
}

compiler/rustc_data_structures/src/graph/scc/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<N: Idx, S: Idx + Ord, A: Annotation> Sccs<N, S, A> {
133133
/// meaning that if `S1 -> S2`, we will visit `S2` first and `S1` after.
134134
/// This is convenient when the edges represent dependencies: when you visit
135135
/// `S1`, the value for `S2` will already have been computed.
136-
pub fn all_sccs(&self) -> impl Iterator<Item = S> + 'static {
136+
pub fn all_sccs(&self) -> impl Iterator<Item = S> + use<N, S, A> {
137137
(0..self.scc_data.len()).map(S::new)
138138
}
139139

compiler/rustc_expand/src/expand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ fn build_single_delegations<'a, Node: InvocationCollectorNode>(
17271727
suffixes: &'a [(Ident, Option<Ident>)],
17281728
item_span: Span,
17291729
from_glob: bool,
1730-
) -> impl Iterator<Item = ast::Item<Node::ItemKind>> + 'a {
1730+
) -> impl Iterator<Item = ast::Item<Node::ItemKind>> + use<'a, Node> {
17311731
if suffixes.is_empty() {
17321732
// Report an error for now, to avoid keeping stem for resolution and
17331733
// stability checks.

compiler/rustc_expand/src/proc_macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<T> pm::bridge::server::MessagePipe<T> for MessagePipe<T> {
3131
}
3232
}
3333

34-
fn exec_strategy(ecx: &ExtCtxt<'_>) -> impl pm::bridge::server::ExecutionStrategy + 'static {
34+
fn exec_strategy(ecx: &ExtCtxt<'_>) -> impl pm::bridge::server::ExecutionStrategy + use<> {
3535
pm::bridge::server::MaybeCrossThread::<MessagePipe<_>>::new(
3636
ecx.sess.opts.unstable_opts.proc_macro_execution_strategy
3737
== ProcMacroExecutionStrategy::CrossThread,

compiler/rustc_index/src/slice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<I: Idx, T> IndexSlice<I, T> {
7070
#[inline]
7171
pub fn indices(
7272
&self,
73-
) -> impl DoubleEndedIterator<Item = I> + ExactSizeIterator + Clone + 'static {
73+
) -> impl DoubleEndedIterator<Item = I> + ExactSizeIterator + Clone + use<I, T> {
7474
(0..self.len()).map(|n| I::new(n))
7575
}
7676

compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
10211021
&self,
10221022
path: &'tcx hir::Path<'tcx>,
10231023
args: GenericArgsRef<'tcx>,
1024-
) -> impl Iterator<Item = InsertableGenericArgs<'tcx>> + 'tcx {
1024+
) -> impl Iterator<Item = InsertableGenericArgs<'tcx>> + use<'tcx> {
10251025
let tcx = self.tecx.tcx;
10261026
let have_turbofish = path.segments.iter().any(|segment| {
10271027
segment.args.is_some_and(|args| args.args.iter().any(|arg| arg.is_ty_or_const()))

compiler/rustc_trait_selection/src/solve/fulfill.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ impl<'tcx> ObligationStorage<'tcx> {
7070
obligations
7171
}
7272

73-
fn unstalled_for_select(&mut self) -> impl Iterator<Item = PredicateObligation<'tcx>> + 'tcx {
73+
fn unstalled_for_select(
74+
&mut self,
75+
) -> impl Iterator<Item = PredicateObligation<'tcx>> + use<'tcx> {
7476
mem::take(&mut self.pending).into_iter()
7577
}
7678

0 commit comments

Comments
 (0)