Skip to content

Commit 610f9bc

Browse files
Actually use precise capturing in favor of outlives
1 parent c969768 commit 610f9bc

File tree

15 files changed

+19
-9
lines changed

15 files changed

+19
-9
lines changed

compiler/rustc_borrowck/src/borrow_set.rs

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

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

compiler/rustc_borrowck/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
// tidy-alphabetical-start
44
#![allow(internal_features)]
5+
#![cfg_attr(bootstrap, feature(precise_capturing))]
56
#![doc(rust_logo)]
67
#![feature(assert_matches)]
78
#![feature(box_patterns)]

compiler/rustc_borrowck/src/universal_regions.rs

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

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

compiler/rustc_codegen_ssa/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![allow(internal_features)]
33
#![allow(rustc::diagnostic_outside_of_impl)]
44
#![allow(rustc::untranslatable_diagnostic)]
5+
#![cfg_attr(bootstrap, feature(precise_capturing))]
56
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
67
#![doc(rust_logo)]
78
#![feature(assert_matches)]

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_data_structures/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#![allow(internal_features)]
1111
#![allow(rustc::default_hash_types)]
1212
#![allow(rustc::potential_query_instability)]
13+
#![cfg_attr(bootstrap, feature(precise_capturing))]
1314
#![cfg_attr(not(parallel_compiler), feature(cell_leak))]
1415
#![deny(unsafe_op_in_unsafe_fn)]
1516
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]

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/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// tidy-alphabetical-start
22
#![allow(internal_features)]
33
#![allow(rustc::diagnostic_outside_of_impl)]
4+
#![cfg_attr(bootstrap, feature(precise_capturing))]
45
#![doc(rust_logo)]
56
#![feature(array_windows)]
67
#![feature(associated_type_defaults)]

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/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// tidy-alphabetical-start
22
#![cfg_attr(all(feature = "nightly", test), feature(stmt_expr_attributes))]
3+
#![cfg_attr(bootstrap, feature(precise_capturing))]
34
#![cfg_attr(feature = "nightly", allow(internal_features))]
45
#![cfg_attr(feature = "nightly", feature(extend_one, new_uninit, step_trait, test))]
56
#![cfg_attr(feature = "nightly", feature(new_zeroed_alloc))]

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
@@ -978,7 +978,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
978978
&self,
979979
path: &'tcx hir::Path<'tcx>,
980980
args: GenericArgsRef<'tcx>,
981-
) -> impl Iterator<Item = InsertableGenericArgs<'tcx>> + 'tcx {
981+
) -> impl Iterator<Item = InsertableGenericArgs<'tcx>> + use<'tcx> {
982982
let tcx = self.tecx.tcx;
983983
let have_turbofish = path.segments.iter().any(|segment| {
984984
segment.args.is_some_and(|args| args.args.iter().any(|arg| arg.is_ty_or_const()))

compiler/rustc_trait_selection/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#![allow(internal_features)]
1515
#![allow(rustc::diagnostic_outside_of_impl)]
1616
#![allow(rustc::untranslatable_diagnostic)]
17+
#![cfg_attr(bootstrap, feature(precise_capturing))]
1718
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1819
#![doc(rust_logo)]
1920
#![feature(assert_matches)]

compiler/rustc_trait_selection/src/solve/fulfill.rs

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

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

0 commit comments

Comments
 (0)