Skip to content

Commit f029558

Browse files
committed
Stabilize associated type position impl Trait (ATPIT)
1 parent f3b9d47 commit f029558

File tree

135 files changed

+129
-356
lines changed

Some content is hidden

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

135 files changed

+129
-356
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,7 @@ impl<'a> PostExpansionVisitor<'a> {
120120
impl Visitor<'_> for ImplTraitVisitor<'_> {
121121
fn visit_ty(&mut self, ty: &ast::Ty) {
122122
if let ast::TyKind::ImplTrait(..) = ty.kind {
123-
if self.in_associated_ty {
124-
gate!(
125-
&self.vis,
126-
impl_trait_in_assoc_type,
127-
ty.span,
128-
"`impl Trait` in associated types is unstable"
129-
);
130-
} else {
123+
if !self.in_associated_ty {
131124
gate!(
132125
&self.vis,
133126
type_alias_impl_trait,

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#![feature(iter_intersperse)]
1515
#![feature(let_chains)]
1616
#![feature(min_specialization)]
17-
#![feature(impl_trait_in_assoc_type)]
17+
#![cfg_attr(bootstrap, feature(impl_trait_in_assoc_type))]
1818
#![deny(rustc::untranslatable_diagnostic)]
1919
#![deny(rustc::diagnostic_outside_of_impl)]
2020

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ declare_features! (
197197
/// + `impl<I:Iterator> Iterator for &mut Iterator`
198198
/// + `impl Debug for Foo<'_>`
199199
(accepted, impl_header_lifetime_elision, "1.31.0", Some(15872)),
200+
/// Allows `impl Trait` to be used inside associated types (RFC 2515).
201+
(accepted, impl_trait_in_assoc_type, "CURRENT_RUSTC_VERSION", Some(63063)),
200202
/// Allows referencing `Self` and projections in impl-trait.
201203
(accepted, impl_trait_projections, "1.74.0", Some(103532)),
202204
/// Allows using `a..=b` and `..=b` as inclusive range syntaxes.

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,6 @@ declare_features! (
485485
(unstable, half_open_range_patterns_in_slices, "1.66.0", Some(67264)),
486486
/// Allows `if let` guard in match arms.
487487
(unstable, if_let_guard, "1.47.0", Some(51114)),
488-
/// Allows `impl Trait` to be used inside associated types (RFC 2515).
489-
(unstable, impl_trait_in_assoc_type, "1.70.0", Some(63063)),
490488
/// Allows `impl Trait` as output type in `Fn` traits in return position of functions.
491489
(unstable, impl_trait_in_fn_trait_return, "1.64.0", Some(99697)),
492490
/// Allows using imported `main` function

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#![feature(const_type_name)]
66
#![feature(cow_is_borrowed)]
77
#![feature(decl_macro)]
8-
#![feature(impl_trait_in_assoc_type)]
8+
#![cfg_attr(bootstrap, feature(impl_trait_in_assoc_type))]
99
#![feature(inline_const)]
1010
#![feature(is_sorted)]
1111
#![feature(let_chains)]

src/librustdoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#![feature(assert_matches)]
77
#![feature(box_patterns)]
88
#![feature(if_let_guard)]
9-
#![feature(impl_trait_in_assoc_type)]
109
#![feature(iter_intersperse)]
1110
#![feature(lazy_cell)]
1211
#![feature(let_chains)]

tests/rustdoc/auxiliary/issue-73061.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//edition:2018
22

3-
#![feature(impl_trait_in_assoc_type)]
4-
53
pub trait Foo {
64
type X: std::future::Future<Output = ()>;
75
fn x(&self) -> Self::X;

tests/ui/associated-types/issue-63591.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// check-pass
22

33
#![feature(associated_type_bounds)]
4-
#![feature(impl_trait_in_assoc_type)]
54

65
fn main() {}
76

tests/ui/coroutine/issue-87142.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Regression test for #87142
55
// This test needs the above flags and the "lib" crate type.
66

7-
#![feature(impl_trait_in_assoc_type, coroutine_trait, coroutines)]
7+
#![feature(coroutine_trait, coroutines)]
88
#![crate_type = "lib"]
99

1010
use std::ops::Coroutine;

tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs

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

0 commit comments

Comments
 (0)