Skip to content

Commit c63f3fe

Browse files
Stabilize associated type bounds
1 parent a655e64 commit c63f3fe

File tree

95 files changed

+147
-533
lines changed

Some content is hidden

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

95 files changed

+147
-533
lines changed

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![doc(rust_logo)]
1212
#![allow(internal_features)]
1313
#![feature(rustdoc_internals)]
14-
#![feature(associated_type_bounds)]
14+
#![cfg_attr(bootstrap, feature(associated_type_bounds))]
1515
#![feature(associated_type_defaults)]
1616
#![feature(box_patterns)]
1717
#![feature(if_let_guard)]

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
452452
constraint.span,
453453
"return type notation is experimental"
454454
);
455-
} else {
456-
gate!(
457-
&self,
458-
associated_type_bounds,
459-
constraint.span,
460-
"associated type bounds are unstable"
461-
);
462455
}
463456
}
464457
visit::walk_assoc_constraint(self, constraint)
@@ -604,7 +597,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
604597
}
605598

606599
gate_all_legacy_dont_use!(trait_alias, "trait aliases are experimental");
607-
gate_all_legacy_dont_use!(associated_type_bounds, "associated type bounds are unstable");
608600
// Despite being a new feature, `where T: Trait<Assoc(): Sized>`, which is RTN syntax now,
609601
// used to be gated under associated_type_bounds, which are right above, so RTN needs to
610602
// be too.

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![feature(rustdoc_internals)]
55
#![doc(rust_logo)]
66
#![feature(assert_matches)]
7-
#![feature(associated_type_bounds)]
7+
#![cfg_attr(bootstrap, feature(associated_type_bounds))]
88
#![feature(box_patterns)]
99
#![feature(control_flow_enum)]
1010
#![feature(let_chains)]

compiler/rustc_codegen_gcc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
#![feature(
1919
rustc_private,
2020
decl_macro,
21-
associated_type_bounds,
2221
never_type,
2322
trusted_len,
2423
hash_raw_entry
2524
)]
25+
#![cfg_attr(bootstrap, feature(associated_type_bounds))]
2626
#![allow(broken_intra_doc_links)]
2727
#![recursion_limit="256"]
2828
#![warn(rust_2018_idioms)]

compiler/rustc_codegen_ssa/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![allow(internal_features)]
55
#![allow(rustc::diagnostic_outside_of_impl)]
66
#![allow(rustc::untranslatable_diagnostic)]
7-
#![feature(associated_type_bounds)]
7+
#![cfg_attr(bootstrap, feature(associated_type_bounds))]
88
#![feature(box_patterns)]
99
#![feature(if_let_guard)]
1010
#![feature(let_chains)]

compiler/rustc_error_codes/src/error_codes/E0719.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ An associated type value was specified more than once.
33
Erroneous code example:
44

55
```compile_fail,E0719
6-
#![feature(associated_type_bounds)]
7-
86
trait FooTrait {}
97
trait BarTrait {}
108
@@ -19,8 +17,6 @@ specify the associated type with the new trait.
1917
Corrected example:
2018

2119
```
22-
#![feature(associated_type_bounds)]
23-
2420
trait FooTrait {}
2521
trait BarTrait {}
2622
trait FooBarTrait: FooTrait + BarTrait {}

compiler/rustc_expand/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![doc(rust_logo)]
22
#![feature(rustdoc_internals)]
33
#![feature(array_windows)]
4-
#![feature(associated_type_bounds)]
4+
#![cfg_attr(bootstrap, feature(associated_type_bounds))]
55
#![feature(associated_type_defaults)]
66
#![feature(if_let_guard)]
77
#![feature(let_chains)]

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ declare_features! (
5959
(accepted, asm_sym, "1.66.0", Some(93333)),
6060
/// Allows the definition of associated constants in `trait` or `impl` blocks.
6161
(accepted, associated_consts, "1.20.0", Some(29646)),
62+
/// Allows the user of associated type bounds.
63+
(accepted, associated_type_bounds, "CURRENT_RUSTC_VERSION", Some(52662)),
6264
/// Allows using associated `type`s in `trait`s.
6365
(accepted, associated_types, "1.0.0", None),
6466
/// Allows free and inherent `async fn`s, `async` blocks, and `<expr>.await` expressions.

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ declare_features! (
351351
(unstable, asm_unwind, "1.58.0", Some(93334)),
352352
/// Allows users to enforce equality of associated constants `TraitImpl<AssocConst=3>`.
353353
(unstable, associated_const_equality, "1.58.0", Some(92827)),
354-
/// Allows the user of associated type bounds.
355-
(unstable, associated_type_bounds, "1.34.0", Some(52662)),
356354
/// Allows associated type defaults.
357355
(unstable, associated_type_defaults, "1.2.0", Some(29661)),
358356
/// Allows `async || body` closures.

compiler/rustc_infer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#![allow(internal_features)]
1919
#![allow(rustc::diagnostic_outside_of_impl)]
2020
#![allow(rustc::untranslatable_diagnostic)]
21-
#![feature(associated_type_bounds)]
21+
#![cfg_attr(bootstrap, feature(associated_type_bounds))]
2222
#![feature(box_patterns)]
2323
#![feature(control_flow_enum)]
2424
#![feature(extend_one)]

0 commit comments

Comments
 (0)