diff options
| author | Camelid <camelidcamel@gmail.com> | 2020-11-22 19:54:31 -0800 |
|---|---|---|
| committer | Camelid <camelidcamel@gmail.com> | 2020-11-23 14:14:06 -0800 |
| commit | 810324d1f31eb8d75e8f0044df720652986ef133 (patch) | |
| tree | d39090e4280a751c21f31e81259a4157c8d133da /compiler | |
| parent | 32da90b431919eedb3e281a91caea063ba4edb77 (diff) | |
| download | rust-810324d1f31eb8d75e8f0044df720652986ef133.tar.gz rust-810324d1f31eb8d75e8f0044df720652986ef133.zip | |
Rename `optin_builtin_traits` to `auto_traits`
They were originally called "opt-in, built-in traits" (OIBITs), but people realized that the name was too confusing and a mouthful, and so they were renamed to just "auto traits". The feature flag's name wasn't updated, though, so that's what this PR does. There are some other spots in the compiler that still refer to OIBITs, but I don't think changing those now is worth it since they are internal and not particularly relevant to this PR. Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_ast_passes/src/feature_gate.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/mini_core.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_data_structures/src/lib.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0198.md | 2 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0321.md | 2 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0567.md | 4 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0568.md | 4 | ||||
| -rw-r--r-- | compiler/rustc_feature/src/active.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_feature/src/removed.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 1 |
10 files changed, 19 insertions, 13 deletions
diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 181783441f3..5b75fbf339b 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -370,7 +370,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { ast::ItemKind::Trait(ast::IsAuto::Yes, ..) => { gate_feature_post!( &self, - optin_builtin_traits, + auto_traits, i.span, "auto traits are experimental and possibly buggy" ); diff --git a/compiler/rustc_codegen_cranelift/example/mini_core.rs b/compiler/rustc_codegen_cranelift/example/mini_core.rs index ce07fe83df1..10cba992056 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core.rs @@ -1,6 +1,6 @@ #![feature( no_core, lang_items, intrinsics, unboxed_closures, type_ascription, extern_types, - untagged_unions, decl_macro, rustc_attrs, transparent_unions, optin_builtin_traits, + untagged_unions, decl_macro, rustc_attrs, transparent_unions, auto_traits, thread_local, )] #![no_core] diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index 01604477c3e..d903a557c7f 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -15,7 +15,8 @@ #![feature(fn_traits)] #![feature(int_bits_const)] #![feature(min_specialization)] -#![feature(optin_builtin_traits)] +#![cfg_attr(bootstrap, feature(optin_builtin_traits))] +#![cfg_attr(not(bootstrap), feature(auto_traits))] #![feature(nll)] #![feature(allow_internal_unstable)] #![feature(hash_raw_entry)] diff --git a/compiler/rustc_error_codes/src/error_codes/E0198.md b/compiler/rustc_error_codes/src/error_codes/E0198.md index 90f1e542874..1238165cb88 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0198.md +++ b/compiler/rustc_error_codes/src/error_codes/E0198.md @@ -16,7 +16,7 @@ unsafe. This will compile: ```ignore (ignore auto_trait future compatibility warning) -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] struct Foo; diff --git a/compiler/rustc_error_codes/src/error_codes/E0321.md b/compiler/rustc_error_codes/src/error_codes/E0321.md index bfcdabfe9de..bcfc12897c5 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0321.md +++ b/compiler/rustc_error_codes/src/error_codes/E0321.md @@ -4,7 +4,7 @@ or enum type. Erroneous code example: ```compile_fail,E0321 -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] struct Foo; diff --git a/compiler/rustc_error_codes/src/error_codes/E0567.md b/compiler/rustc_error_codes/src/error_codes/E0567.md index 05cf8fed031..bc13ee4c04c 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0567.md +++ b/compiler/rustc_error_codes/src/error_codes/E0567.md @@ -3,7 +3,7 @@ Generics have been used on an auto trait. Erroneous code example: ```compile_fail,E0567 -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] auto trait Generic<T> {} // error! # fn main() {} @@ -16,7 +16,7 @@ parameters. To fix this issue, just remove the generics: ``` -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] auto trait Generic {} // ok! # fn main() {} diff --git a/compiler/rustc_error_codes/src/error_codes/E0568.md b/compiler/rustc_error_codes/src/error_codes/E0568.md index a37381f1cbd..17b3f5e31bd 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0568.md +++ b/compiler/rustc_error_codes/src/error_codes/E0568.md @@ -3,7 +3,7 @@ A super trait has been added to an auto trait. Erroneous code example: ```compile_fail,E0568 -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] auto trait Bound : Copy {} // error! @@ -18,7 +18,7 @@ all the existing types could implement `Bound` because very few of them have the To fix this issue, just remove the super trait: ``` -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] auto trait Bound {} // ok! diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index a0355079247..75337634d3f 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -149,9 +149,6 @@ declare_features! ( /// Allows using the `#[linkage = ".."]` attribute. (active, linkage, "1.0.0", Some(29603), None), - /// Allows features specific to OIBIT (auto traits). - (active, optin_builtin_traits, "1.0.0", Some(13231), None), - /// Allows using `box` in patterns (RFC 469). (active, box_patterns, "1.0.0", Some(29641), None), @@ -215,6 +212,10 @@ declare_features! ( /// purpose as `#[allow_internal_unstable]`. (active, rustc_allow_const_fn_unstable, "1.49.0", Some(69399), None), + /// Allows features specific to auto traits. + /// Renamed from `optin_builtin_traits`. + (active, auto_traits, "1.50.0", Some(13231), None), + // no-tracking-issue-end // ------------------------------------------------------------------------- diff --git a/compiler/rustc_feature/src/removed.rs b/compiler/rustc_feature/src/removed.rs index a480ddc7f34..07bd1602cda 100644 --- a/compiler/rustc_feature/src/removed.rs +++ b/compiler/rustc_feature/src/removed.rs @@ -71,6 +71,10 @@ declare_features! ( /// Allows using custom attributes (RFC 572). (removed, custom_attribute, "1.0.0", Some(29642), None, Some("removed in favor of `#![register_tool]` and `#![register_attr]`")), + /// Allows features specific to OIBIT (now called auto traits). + /// Renamed to `auto_traits`. + (removed, optin_builtin_traits, "1.0.0", Some(13231), None, + Some("renamed to `auto_traits`")), (removed, pushpop_unsafe, "1.2.0", None, None, None), (removed, needs_allocator, "1.4.0", Some(27389), None, Some("subsumed by `#![feature(allocator_internals)]`")), @@ -113,7 +117,6 @@ declare_features! ( Some("removed in favor of `#![feature(marker_trait_attr)]`")), /// Allows `#[no_debug]`. (removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")), - /// Allows comparing raw pointers during const eval. (removed, const_compare_raw_pointers, "1.46.0", Some(53020), None, Some("cannot be allowed in const eval in any meaningful way")), diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 338ff005995..d5fccdeb189 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -285,6 +285,7 @@ symbols! { attr_literals, attributes, augmented_assignments, + auto_traits, automatically_derived, avx512_target_feature, await_macro, |
