From 810324d1f31eb8d75e8f0044df720652986ef133 Mon Sep 17 00:00:00 2001 From: Camelid Date: Sun, 22 Nov 2020 19:54:31 -0800 Subject: [PATCH] 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 . --- compiler/rustc_ast_passes/src/feature_gate.rs | 2 +- compiler/rustc_codegen_cranelift/example/mini_core.rs | 2 +- compiler/rustc_data_structures/src/lib.rs | 3 ++- compiler/rustc_error_codes/src/error_codes/E0198.md | 2 +- compiler/rustc_error_codes/src/error_codes/E0321.md | 2 +- compiler/rustc_error_codes/src/error_codes/E0567.md | 4 ++-- compiler/rustc_error_codes/src/error_codes/E0568.md | 4 ++-- compiler/rustc_feature/src/active.rs | 7 ++++--- compiler/rustc_feature/src/removed.rs | 5 ++++- compiler/rustc_span/src/symbol.rs | 1 + library/alloc/src/lib.rs | 3 ++- library/core/src/lib.rs | 3 ++- library/proc_macro/src/lib.rs | 3 ++- library/rtstartup/rsbegin.rs | 7 +++++-- library/rtstartup/rsend.rs | 5 ++++- library/std/src/lib.rs | 3 ++- .../{optin-builtin-traits.md => auto-traits.md} | 6 +++--- src/test/pretty/auto-trait.rs | 2 +- src/test/run-make-fulldeps/simd-ffi/simd.rs | 2 +- src/test/run-make-fulldeps/target-specs/foo.rs | 2 +- src/test/rustdoc/auto-traits.rs | 2 +- src/test/rustdoc/auto_aliases.rs | 2 +- src/test/rustdoc/auxiliary/auto-traits.rs | 2 +- src/test/rustdoc/auxiliary/rustdoc-default-impl.rs | 2 +- .../rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs | 2 +- src/test/rustdoc/impl-parts.rs | 2 +- src/test/rustdoc/synthetic_auto/crate-local.rs | 2 +- src/test/ui/async-await/issue-64130-3-other.rs | 2 +- src/test/ui/auto-traits/auto-trait-validation.rs | 2 +- src/test/ui/auto-traits/auto-traits.rs | 2 +- src/test/ui/auto-traits/issue-23080-2.rs | 2 +- src/test/ui/auto-traits/issue-23080.rs | 2 +- .../ui/auto-traits/typeck-auto-trait-no-supertraits-2.rs | 2 +- .../ui/auto-traits/typeck-auto-trait-no-supertraits.rs | 2 +- .../typeck-default-trait-impl-constituent-types-2.rs | 2 +- .../typeck-default-trait-impl-constituent-types.rs | 2 +- .../ui/auto-traits/typeck-default-trait-impl-negation.rs | 2 +- .../ui/auto-traits/typeck-default-trait-impl-precedence.rs | 2 +- src/test/ui/coherence/coherence-default-trait-impl.rs | 2 +- .../coherence-impl-trait-for-marker-trait-negative.rs | 2 +- .../coherence-impl-trait-for-marker-trait-positive.rs | 2 +- ...optin-builtin-traits.rs => feature-gate-auto-traits.rs} | 2 +- ...iltin-traits.stderr => feature-gate-auto-traits.stderr} | 6 +++--- src/test/ui/generator/auto-trait-regions.rs | 2 +- src/test/ui/issues/issue-29516.rs | 2 +- src/test/ui/never_type/auto-traits.rs | 2 +- src/test/ui/parser/trait-object-bad-parens.rs | 2 +- src/test/ui/phantom-oibit.rs | 2 +- src/test/ui/privacy/private-in-public-non-principal-2.rs | 2 +- src/test/ui/privacy/private-in-public-non-principal.rs | 2 +- src/test/ui/specialization/specialization-polarity.rs | 2 +- src/test/ui/symbol-names/impl1.rs | 2 +- .../traits/traits-inductive-overflow-supertrait-oibit.rs | 2 +- src/test/ui/typeck/auxiliary/tdticc_coherence_lib.rs | 2 +- 54 files changed, 78 insertions(+), 62 deletions(-) rename src/doc/unstable-book/src/language-features/{optin-builtin-traits.md => auto-traits.md} (95%) rename src/test/ui/feature-gates/{feature-gate-optin-builtin-traits.rs => feature-gate-auto-traits.rs} (89%) rename src/test/ui/feature-gates/{feature-gate-optin-builtin-traits.stderr => feature-gate-auto-traits.stderr} (78%) diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 181783441f3ff..5b75fbf339b92 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 ce07fe83df18f..10cba99205629 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 01604477c3ee3..d903a557c7fdf 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 90f1e54287496..1238165cb88d4 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 bfcdabfe9de7a..bcfc12897c5c3 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 05cf8fed03160..bc13ee4c04cb2 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 {} // 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 a37381f1cbd16..17b3f5e31bdf9 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 a035507924794..75337634d3fda 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 a480ddc7f34b1..07bd1602cda32 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 338ff005995d5..d5fccdeb189cc 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, diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index dc5db49ee9891..3ac34c9ae28af 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -112,7 +112,8 @@ #![feature(never_type)] #![feature(nll)] #![feature(nonnull_slice_from_raw_parts)] -#![feature(optin_builtin_traits)] +#![cfg_attr(bootstrap, feature(optin_builtin_traits))] +#![cfg_attr(not(bootstrap), feature(auto_traits))] #![feature(or_patterns)] #![feature(pattern)] #![feature(ptr_internals)] diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 0f91ff418e3ac..d01cefdcda882 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -119,7 +119,8 @@ #![feature(nll)] #![feature(exhaustive_patterns)] #![feature(no_core)] -#![feature(optin_builtin_traits)] +#![cfg_attr(bootstrap, feature(optin_builtin_traits))] +#![cfg_attr(not(bootstrap), feature(auto_traits))] #![feature(or_patterns)] #![feature(prelude_import)] #![feature(repr_simd, platform_intrinsics)] diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index 3ba706b09e859..5ca7cbe973f7b 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -28,7 +28,8 @@ #![feature(extern_types)] #![feature(in_band_lifetimes)] #![feature(negative_impls)] -#![feature(optin_builtin_traits)] +#![cfg_attr(bootstrap, feature(optin_builtin_traits))] +#![cfg_attr(not(bootstrap), feature(auto_traits))] #![feature(restricted_std)] #![feature(rustc_attrs)] #![feature(min_specialization)] diff --git a/library/rtstartup/rsbegin.rs b/library/rtstartup/rsbegin.rs index bd1946133e8af..b64f13dba4c2e 100644 --- a/library/rtstartup/rsbegin.rs +++ b/library/rtstartup/rsbegin.rs @@ -9,10 +9,13 @@ // headers or footers. // // Note that the actual module entry point is located in the C runtime startup -// object (usually called `crtX.o), which then invokes initialization callbacks +// object (usually called `crtX.o`), which then invokes initialization callbacks // of other runtime components (registered via yet another special image section). -#![feature(no_core, lang_items, optin_builtin_traits)] +#![feature(no_core)] +#![feature(lang_items)] +#![cfg_attr(bootstrap, feature(optin_builtin_traits))] +#![cfg_attr(not(bootstrap), feature(auto_traits))] #![crate_type = "rlib"] #![no_core] #![allow(non_camel_case_types)] diff --git a/library/rtstartup/rsend.rs b/library/rtstartup/rsend.rs index 333761cd9770e..18ee7c19ba0f9 100644 --- a/library/rtstartup/rsend.rs +++ b/library/rtstartup/rsend.rs @@ -1,6 +1,9 @@ // See rsbegin.rs for details. -#![feature(no_core, lang_items, optin_builtin_traits)] +#![feature(no_core)] +#![feature(lang_items)] +#![cfg_attr(bootstrap, feature(optin_builtin_traits))] +#![cfg_attr(not(bootstrap), feature(auto_traits))] #![crate_type = "rlib"] #![no_core] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 3463b8cdf1cbf..f33804c988a1a 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -286,7 +286,8 @@ #![feature(nll)] #![feature(nonnull_slice_from_raw_parts)] #![feature(once_cell)] -#![feature(optin_builtin_traits)] +#![cfg_attr(bootstrap, feature(optin_builtin_traits))] +#![cfg_attr(not(bootstrap), feature(auto_traits))] #![feature(or_patterns)] #![feature(panic_info_message)] #![feature(panic_internals)] diff --git a/src/doc/unstable-book/src/language-features/optin-builtin-traits.md b/src/doc/unstable-book/src/language-features/auto-traits.md similarity index 95% rename from src/doc/unstable-book/src/language-features/optin-builtin-traits.md rename to src/doc/unstable-book/src/language-features/auto-traits.md index 6f0f0cfd33e4d..0ca6dd6670bc4 100644 --- a/src/doc/unstable-book/src/language-features/optin-builtin-traits.md +++ b/src/doc/unstable-book/src/language-features/auto-traits.md @@ -1,4 +1,4 @@ -# `optin_builtin_traits` +# `auto_traits` The tracking issue for this feature is [#13231] @@ -6,7 +6,7 @@ The tracking issue for this feature is [#13231] ---- -The `optin_builtin_traits` feature gate allows you to define auto traits. +The `auto_traits` feature gate allows you to define auto traits. Auto traits, like [`Send`] or [`Sync`] in the standard library, are marker traits that are automatically implemented for every type, unless the type, or a type it contains, @@ -24,7 +24,7 @@ Example: ```rust #![feature(negative_impls)] -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] auto trait Valid {} diff --git a/src/test/pretty/auto-trait.rs b/src/test/pretty/auto-trait.rs index 2eb4d3390be57..61644e7df09ae 100644 --- a/src/test/pretty/auto-trait.rs +++ b/src/test/pretty/auto-trait.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] // pp-exact diff --git a/src/test/run-make-fulldeps/simd-ffi/simd.rs b/src/test/run-make-fulldeps/simd-ffi/simd.rs index c63fe4ddce214..717da367feec5 100644 --- a/src/test/run-make-fulldeps/simd-ffi/simd.rs +++ b/src/test/run-make-fulldeps/simd-ffi/simd.rs @@ -2,7 +2,7 @@ #![crate_type = "lib"] // we can compile to a variety of platforms, because we don't need // cross-compiled standard libraries. -#![feature(no_core, optin_builtin_traits)] +#![feature(no_core, auto_traits)] #![no_core] #![feature(repr_simd, simd_ffi, link_llvm_intrinsics, lang_items, rustc_attrs)] diff --git a/src/test/run-make-fulldeps/target-specs/foo.rs b/src/test/run-make-fulldeps/target-specs/foo.rs index 421300686955c..ee443eb0aa32b 100644 --- a/src/test/run-make-fulldeps/target-specs/foo.rs +++ b/src/test/run-make-fulldeps/target-specs/foo.rs @@ -1,4 +1,4 @@ -#![feature(lang_items, no_core, optin_builtin_traits)] +#![feature(lang_items, no_core, auto_traits)] #![no_core] #[lang="copy"] diff --git a/src/test/rustdoc/auto-traits.rs b/src/test/rustdoc/auto-traits.rs index a1fa611994f1a..93d4bf2f656a3 100644 --- a/src/test/rustdoc/auto-traits.rs +++ b/src/test/rustdoc/auto-traits.rs @@ -1,6 +1,6 @@ // aux-build:auto-traits.rs -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![crate_name = "foo"] diff --git a/src/test/rustdoc/auto_aliases.rs b/src/test/rustdoc/auto_aliases.rs index 7b52a69f5609f..b8f3527510cc9 100644 --- a/src/test/rustdoc/auto_aliases.rs +++ b/src/test/rustdoc/auto_aliases.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] // @has auto_aliases/trait.Bar.html '//h3[@aliases="auto_aliases::Foo"]' 'impl Bar for Foo' pub struct Foo; diff --git a/src/test/rustdoc/auxiliary/auto-traits.rs b/src/test/rustdoc/auxiliary/auto-traits.rs index f52210613888d..84976c73beed5 100644 --- a/src/test/rustdoc/auxiliary/auto-traits.rs +++ b/src/test/rustdoc/auxiliary/auto-traits.rs @@ -1,3 +1,3 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] pub unsafe auto trait Bar {} diff --git a/src/test/rustdoc/auxiliary/rustdoc-default-impl.rs b/src/test/rustdoc/auxiliary/rustdoc-default-impl.rs index 36e2821c5a8b9..032db3b25e673 100644 --- a/src/test/rustdoc/auxiliary/rustdoc-default-impl.rs +++ b/src/test/rustdoc/auxiliary/rustdoc-default-impl.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] pub mod bar { use std::marker; diff --git a/src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs b/src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs index 869aebc774ad4..46adf2e6bc093 100644 --- a/src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs +++ b/src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs @@ -1,3 +1,3 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] pub auto trait AnOibit {} diff --git a/src/test/rustdoc/impl-parts.rs b/src/test/rustdoc/impl-parts.rs index 68baca9a04e9a..5e9e84a554bf7 100644 --- a/src/test/rustdoc/impl-parts.rs +++ b/src/test/rustdoc/impl-parts.rs @@ -1,5 +1,5 @@ #![feature(negative_impls)] -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] pub auto trait AnOibit {} diff --git a/src/test/rustdoc/synthetic_auto/crate-local.rs b/src/test/rustdoc/synthetic_auto/crate-local.rs index 341dd572f81c8..3346ac05ffe47 100644 --- a/src/test/rustdoc/synthetic_auto/crate-local.rs +++ b/src/test/rustdoc/synthetic_auto/crate-local.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] pub auto trait Banana {} diff --git a/src/test/ui/async-await/issue-64130-3-other.rs b/src/test/ui/async-await/issue-64130-3-other.rs index 133152c309a83..7f2e3db6d60f2 100644 --- a/src/test/ui/async-await/issue-64130-3-other.rs +++ b/src/test/ui/async-await/issue-64130-3-other.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] // edition:2018 diff --git a/src/test/ui/auto-traits/auto-trait-validation.rs b/src/test/ui/auto-traits/auto-trait-validation.rs index 34d6c3da00ee3..a997b044c8ff8 100644 --- a/src/test/ui/auto-traits/auto-trait-validation.rs +++ b/src/test/ui/auto-traits/auto-trait-validation.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] auto trait Generic {} //~^ auto traits cannot have generic parameters [E0567] diff --git a/src/test/ui/auto-traits/auto-traits.rs b/src/test/ui/auto-traits/auto-traits.rs index 15fdddc5f3f5c..567b86c276274 100644 --- a/src/test/ui/auto-traits/auto-traits.rs +++ b/src/test/ui/auto-traits/auto-traits.rs @@ -1,6 +1,6 @@ // run-pass #![allow(unused_doc_comments)] -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait Auto {} diff --git a/src/test/ui/auto-traits/issue-23080-2.rs b/src/test/ui/auto-traits/issue-23080-2.rs index 867f24f8cb45e..cb4cf6de1efe9 100644 --- a/src/test/ui/auto-traits/issue-23080-2.rs +++ b/src/test/ui/auto-traits/issue-23080-2.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] unsafe auto trait Trait { diff --git a/src/test/ui/auto-traits/issue-23080.rs b/src/test/ui/auto-traits/issue-23080.rs index 035db82ba5de0..84e2ce66f9dbd 100644 --- a/src/test/ui/auto-traits/issue-23080.rs +++ b/src/test/ui/auto-traits/issue-23080.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] unsafe auto trait Trait { diff --git a/src/test/ui/auto-traits/typeck-auto-trait-no-supertraits-2.rs b/src/test/ui/auto-traits/typeck-auto-trait-no-supertraits-2.rs index 8824a6d2767f7..6cceaf821f6bf 100644 --- a/src/test/ui/auto-traits/typeck-auto-trait-no-supertraits-2.rs +++ b/src/test/ui/auto-traits/typeck-auto-trait-no-supertraits-2.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait Magic : Sized where Option : Magic {} //~ ERROR E0568 diff --git a/src/test/ui/auto-traits/typeck-auto-trait-no-supertraits.rs b/src/test/ui/auto-traits/typeck-auto-trait-no-supertraits.rs index edbca91512486..2a76893febc79 100644 --- a/src/test/ui/auto-traits/typeck-auto-trait-no-supertraits.rs +++ b/src/test/ui/auto-traits/typeck-auto-trait-no-supertraits.rs @@ -22,7 +22,7 @@ // println!("{:?} {:?}", a, b); // } -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait Magic: Copy {} //~ ERROR E0568 diff --git a/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.rs b/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.rs index 71ac2b466c10a..f2fb67f1108f9 100644 --- a/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.rs +++ b/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait MyTrait {} diff --git a/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types.rs b/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types.rs index 6483b9213dc53..73ff46d05e466 100644 --- a/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types.rs +++ b/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait MyTrait {} diff --git a/src/test/ui/auto-traits/typeck-default-trait-impl-negation.rs b/src/test/ui/auto-traits/typeck-default-trait-impl-negation.rs index 47cab60625dce..f7f56f97f614e 100644 --- a/src/test/ui/auto-traits/typeck-default-trait-impl-negation.rs +++ b/src/test/ui/auto-traits/typeck-default-trait-impl-negation.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait MyTrait {} diff --git a/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.rs b/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.rs index 614a5ff55b1ed..2bbe82270bd06 100644 --- a/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.rs +++ b/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.rs @@ -3,7 +3,7 @@ // other words, the auto impl only applies if there are no existing // impls whose types unify. -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait Defaulted { } diff --git a/src/test/ui/coherence/coherence-default-trait-impl.rs b/src/test/ui/coherence/coherence-default-trait-impl.rs index 4115ba34e17b2..d57fb47775403 100644 --- a/src/test/ui/coherence/coherence-default-trait-impl.rs +++ b/src/test/ui/coherence/coherence-default-trait-impl.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait MySafeTrait {} diff --git a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.rs b/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.rs index a9c8d20a79d75..50d9a480ad1e5 100644 --- a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.rs +++ b/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] // Test for issue #56934 - that it is impossible to redundantly diff --git a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.rs b/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.rs index c565f9c83e89e..faac6d983f31e 100644 --- a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.rs +++ b/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] // Test for issue #56934 - that it is impossible to redundantly diff --git a/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.rs b/src/test/ui/feature-gates/feature-gate-auto-traits.rs similarity index 89% rename from src/test/ui/feature-gates/feature-gate-optin-builtin-traits.rs rename to src/test/ui/feature-gates/feature-gate-auto-traits.rs index 35c05b75d365c..80cfa9cee8959 100644 --- a/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.rs +++ b/src/test/ui/feature-gates/feature-gate-auto-traits.rs @@ -1,5 +1,5 @@ // Test that default and negative trait implementations are gated by -// `optin_builtin_traits` feature gate +// `auto_traits` feature gate struct DummyStruct; diff --git a/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.stderr b/src/test/ui/feature-gates/feature-gate-auto-traits.stderr similarity index 78% rename from src/test/ui/feature-gates/feature-gate-optin-builtin-traits.stderr rename to src/test/ui/feature-gates/feature-gate-auto-traits.stderr index 1553d0531dc09..e015418161e5a 100644 --- a/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.stderr +++ b/src/test/ui/feature-gates/feature-gate-auto-traits.stderr @@ -1,14 +1,14 @@ error[E0658]: auto traits are experimental and possibly buggy - --> $DIR/feature-gate-optin-builtin-traits.rs:6:1 + --> $DIR/feature-gate-auto-traits.rs:6:1 | LL | auto trait AutoDummyTrait {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #13231 for more information - = help: add `#![feature(optin_builtin_traits)]` to the crate attributes to enable + = help: add `#![feature(auto_traits)]` to the crate attributes to enable error[E0658]: negative trait bounds are not yet fully implemented; use marker types for now - --> $DIR/feature-gate-optin-builtin-traits.rs:9:6 + --> $DIR/feature-gate-auto-traits.rs:9:6 | LL | impl !AutoDummyTrait for DummyStruct {} | ^^^^^^^^^^^^^^^ diff --git a/src/test/ui/generator/auto-trait-regions.rs b/src/test/ui/generator/auto-trait-regions.rs index 1e77d8058a72b..8f1e4f1b66f48 100644 --- a/src/test/ui/generator/auto-trait-regions.rs +++ b/src/test/ui/generator/auto-trait-regions.rs @@ -1,5 +1,5 @@ #![feature(generators)] -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait Foo {} diff --git a/src/test/ui/issues/issue-29516.rs b/src/test/ui/issues/issue-29516.rs index 035f904b15bb3..6779d508dd6c6 100644 --- a/src/test/ui/issues/issue-29516.rs +++ b/src/test/ui/issues/issue-29516.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait NotSame {} diff --git a/src/test/ui/never_type/auto-traits.rs b/src/test/ui/never_type/auto-traits.rs index 84c8db4053e4f..42ede708e66df 100644 --- a/src/test/ui/never_type/auto-traits.rs +++ b/src/test/ui/never_type/auto-traits.rs @@ -1,6 +1,6 @@ // check-pass -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] #![feature(never_type)] diff --git a/src/test/ui/parser/trait-object-bad-parens.rs b/src/test/ui/parser/trait-object-bad-parens.rs index 0a2836d691f5f..8e267c7448feb 100644 --- a/src/test/ui/parser/trait-object-bad-parens.rs +++ b/src/test/ui/parser/trait-object-bad-parens.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] #![allow(bare_trait_objects)] diff --git a/src/test/ui/phantom-oibit.rs b/src/test/ui/phantom-oibit.rs index 04291a70606c9..14d6f951fa6fc 100644 --- a/src/test/ui/phantom-oibit.rs +++ b/src/test/ui/phantom-oibit.rs @@ -1,7 +1,7 @@ // Ensure that OIBIT checks `T` when it encounters a `PhantomData` field, instead of checking // the `PhantomData` type itself (which almost always implements an auto trait) -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] use std::marker::{PhantomData}; diff --git a/src/test/ui/privacy/private-in-public-non-principal-2.rs b/src/test/ui/privacy/private-in-public-non-principal-2.rs index effcb508e276e..db451d33429b3 100644 --- a/src/test/ui/privacy/private-in-public-non-principal-2.rs +++ b/src/test/ui/privacy/private-in-public-non-principal-2.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] #[allow(private_in_public)] diff --git a/src/test/ui/privacy/private-in-public-non-principal.rs b/src/test/ui/privacy/private-in-public-non-principal.rs index aa946f5c0ac05..ac1d5a9e6a202 100644 --- a/src/test/ui/privacy/private-in-public-non-principal.rs +++ b/src/test/ui/privacy/private-in-public-non-principal.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] pub trait PubPrincipal {} diff --git a/src/test/ui/specialization/specialization-polarity.rs b/src/test/ui/specialization/specialization-polarity.rs index 17897d8b803d9..b3cd8255bb9b1 100644 --- a/src/test/ui/specialization/specialization-polarity.rs +++ b/src/test/ui/specialization/specialization-polarity.rs @@ -1,6 +1,6 @@ // Make sure specialization cannot change impl polarity -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] #![feature(specialization)] //~ WARN the feature `specialization` is incomplete diff --git a/src/test/ui/symbol-names/impl1.rs b/src/test/ui/symbol-names/impl1.rs index 1ada54cc102ed..05bd98df0064a 100644 --- a/src/test/ui/symbol-names/impl1.rs +++ b/src/test/ui/symbol-names/impl1.rs @@ -6,7 +6,7 @@ //[legacy]normalize-stderr-32bit: "hee444285569b39c2" -> "SYMBOL_HASH" //[legacy]normalize-stderr-64bit: "h310ea0259fc3d32d" -> "SYMBOL_HASH" -#![feature(optin_builtin_traits, rustc_attrs)] +#![feature(auto_traits, rustc_attrs)] #![allow(dead_code)] mod foo { diff --git a/src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.rs b/src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.rs index 571f934fc5bc7..21f299505ccba 100644 --- a/src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.rs +++ b/src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.rs @@ -2,7 +2,7 @@ // a simple OIBIT `..` impl alone still doesn't allow arbitrary bounds // to be synthesized. -#![feature(optin_builtin_traits)] +#![feature(auto_traits)] #![feature(negative_impls)] auto trait Magic: Copy {} //~ ERROR E0568 diff --git a/src/test/ui/typeck/auxiliary/tdticc_coherence_lib.rs b/src/test/ui/typeck/auxiliary/tdticc_coherence_lib.rs index d00025b770861..ef2cd415fcaaa 100644 --- a/src/test/ui/typeck/auxiliary/tdticc_coherence_lib.rs +++ b/src/test/ui/typeck/auxiliary/tdticc_coherence_lib.rs @@ -1,4 +1,4 @@ -#![feature(optin_builtin_traits, core)] +#![feature(auto_traits, core)] #![crate_type = "rlib"] pub auto trait DefaultedTrait { }