Skip to content

Commit eae5b5c

Browse files
Stabilize opaque type precise capturing
1 parent c6f81a4 commit eae5b5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+70
-134
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
557557
gate_all!(fn_delegation, "functions delegation is not yet fully implemented");
558558
gate_all!(postfix_match, "postfix match is experimental");
559559
gate_all!(mut_ref, "mutable by-reference bindings are experimental");
560-
gate_all!(precise_capturing, "precise captures on `impl Trait` are experimental");
561560
gate_all!(global_registration, "global registration is experimental");
562561
gate_all!(unsafe_attributes, "`#[unsafe()]` markers for attributes are experimental");
563562
gate_all!(return_type_notation, "return type notation is experimental");

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ declare_features! (
309309
(accepted, param_attrs, "1.39.0", Some(60406)),
310310
/// Allows parentheses in patterns.
311311
(accepted, pattern_parentheses, "1.31.0", Some(51087)),
312+
/// Allows `use<'a, 'b, A, B>` in `impl Trait + use<...>` for precise capture of generic args.
313+
(accepted, precise_capturing, "CURRENT_RUSTC_VERSION", Some(123432)),
312314
/// Allows procedural macros in `proc-macro` crates.
313315
(accepted, proc_macro, "1.29.0", Some(38356)),
314316
/// Allows multi-segment paths in attributes and derives.

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,6 @@ declare_features! (
561561
(unstable, patchable_function_entry, "1.81.0", Some(123115)),
562562
/// Allows postfix match `expr.match { ... }`
563563
(unstable, postfix_match, "1.79.0", Some(121618)),
564-
/// Allows `use<'a, 'b, A, B>` in `impl Trait + use<...>` for precise capture of generic args.
565-
(unstable, precise_capturing, "1.79.0", Some(123432)),
566564
/// Allows macro attributes on expressions, statements and non-inline modules.
567565
(unstable, proc_macro_hygiene, "1.30.0", Some(54727)),
568566
/// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions.

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2773,7 +2773,6 @@ impl PreciseCapturingArg<'_> {
27732773
/// resolution to. Lifetimes don't have this problem, and for them, it's actually
27742774
/// kind of detrimental to use a custom node type versus just using [`Lifetime`],
27752775
/// since resolve_bound_vars operates on `Lifetime`s.
2776-
// FIXME(precise_capturing): Investigate storing this as a path instead?
27772776
#[derive(Debug, Clone, Copy, HashStable_Generic)]
27782777
pub struct PreciseCapturingNonLifetimeArg {
27792778
pub hir_id: HirId,

compiler/rustc_lint/src/impl_trait_overcaptures.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ declare_lint! {
2727
/// ### Example
2828
///
2929
/// ```rust,compile_fail
30-
/// # #![feature(precise_capturing)]
31-
/// # #![allow(incomplete_features)]
3230
/// # #![deny(impl_trait_overcaptures)]
3331
/// # use std::fmt::Display;
3432
/// let mut x = vec![];
@@ -56,7 +54,6 @@ declare_lint! {
5654
pub IMPL_TRAIT_OVERCAPTURES,
5755
Allow,
5856
"`impl Trait` will capture more lifetimes than possibly intended in edition 2024",
59-
@feature_gate = precise_capturing;
6057
//@future_incompatible = FutureIncompatibleInfo {
6158
// reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),
6259
// reference: "<FIXME>",
@@ -75,8 +72,7 @@ declare_lint! {
7572
/// ### Example
7673
///
7774
/// ```rust,compile_fail
78-
/// # #![feature(precise_capturing, lifetime_capture_rules_2024)]
79-
/// # #![allow(incomplete_features)]
75+
/// # #![feature(lifetime_capture_rules_2024)]
8076
/// # #![deny(impl_trait_redundant_captures)]
8177
/// fn test<'a>(x: &'a i32) -> impl Sized + use<'a> { x }
8278
/// ```
@@ -90,7 +86,6 @@ declare_lint! {
9086
pub IMPL_TRAIT_REDUNDANT_CAPTURES,
9187
Warn,
9288
"redundant precise-capturing `use<...>` syntax on an `impl Trait`",
93-
@feature_gate = precise_capturing;
9489
}
9590

9691
declare_lint_pass!(

compiler/rustc_parse/src/parser/ty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,6 @@ impl<'a> Parser<'a> {
851851
// lifetimes and ident params (including SelfUpper). These are validated later
852852
// for order, duplication, and whether they actually reference params.
853853
let use_span = self.prev_token.span;
854-
self.psess.gated_spans.gate(sym::precise_capturing, use_span);
855854
let (args, args_span) = self.parse_precise_capturing_args()?;
856855
GenericBound::Use(args, use_span.to(args_span))
857856
} else {

tests/rustdoc-json/impl-trait-precise-capturing.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(precise_capturing)]
2-
31
//@ is "$.index[*][?(@.name=='hello')].inner.function.decl.output.impl_trait[1].use[0]" \"\'a\"
42
//@ is "$.index[*][?(@.name=='hello')].inner.function.decl.output.impl_trait[1].use[1]" \"T\"
53
//@ is "$.index[*][?(@.name=='hello')].inner.function.decl.output.impl_trait[1].use[2]" \"N\"

tests/rustdoc/impl-trait-precise-capturing.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ aux-build:precise-capturing.rs
22

33
#![crate_name = "foo"]
4-
#![feature(precise_capturing)]
54

65
extern crate precise_capturing;
76

tests/ui/feature-gates/feature-gate-precise-capturing.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/ui/feature-gates/feature-gate-precise-capturing.stderr

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)