Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ec039bd

Browse files
committed
Auto merge of rust-lang#79336 - camelid:rename-feature-oibit-to-auto, r=oli-obk
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>. r? `@oli-obk` (feel free to re-assign if you're not the right reviewer for this)
2 parents b387f62 + 82dc99b commit ec039bd

File tree

60 files changed

+98
-82
lines changed

Some content is hidden

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

60 files changed

+98
-82
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
370370
ast::ItemKind::Trait(ast::IsAuto::Yes, ..) => {
371371
gate_feature_post!(
372372
&self,
373-
optin_builtin_traits,
373+
auto_traits,
374374
i.span,
375375
"auto traits are experimental and possibly buggy"
376376
);

compiler/rustc_codegen_cranelift/example/mini_core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(
22
no_core, lang_items, intrinsics, unboxed_closures, type_ascription, extern_types,
3-
untagged_unions, decl_macro, rustc_attrs, transparent_unions, optin_builtin_traits,
3+
untagged_unions, decl_macro, rustc_attrs, transparent_unions, auto_traits,
44
thread_local,
55
)]
66
#![no_core]

compiler/rustc_data_structures/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
#![feature(fn_traits)]
1616
#![feature(int_bits_const)]
1717
#![feature(min_specialization)]
18-
#![feature(optin_builtin_traits)]
18+
#![cfg_attr(bootstrap, feature(optin_builtin_traits))]
19+
#![cfg_attr(not(bootstrap), feature(auto_traits))]
1920
#![feature(nll)]
2021
#![feature(allow_internal_unstable)]
2122
#![feature(hash_raw_entry)]

compiler/rustc_error_codes/src/error_codes/E0198.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ unsafe.
1616
This will compile:
1717

1818
```ignore (ignore auto_trait future compatibility warning)
19-
#![feature(optin_builtin_traits)]
19+
#![feature(auto_traits)]
2020
2121
struct Foo;
2222

compiler/rustc_error_codes/src/error_codes/E0321.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ or enum type.
44
Erroneous code example:
55

66
```compile_fail,E0321
7-
#![feature(optin_builtin_traits)]
7+
#![feature(auto_traits)]
88
99
struct Foo;
1010

compiler/rustc_error_codes/src/error_codes/E0567.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Generics have been used on an auto trait.
33
Erroneous code example:
44

55
```compile_fail,E0567
6-
#![feature(optin_builtin_traits)]
6+
#![feature(auto_traits)]
77
88
auto trait Generic<T> {} // error!
99
# fn main() {}
@@ -16,7 +16,7 @@ parameters.
1616
To fix this issue, just remove the generics:
1717

1818
```
19-
#![feature(optin_builtin_traits)]
19+
#![feature(auto_traits)]
2020
2121
auto trait Generic {} // ok!
2222
# fn main() {}

compiler/rustc_error_codes/src/error_codes/E0568.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ A super trait has been added to an auto trait.
33
Erroneous code example:
44

55
```compile_fail,E0568
6-
#![feature(optin_builtin_traits)]
6+
#![feature(auto_traits)]
77
88
auto trait Bound : Copy {} // error!
99
@@ -18,7 +18,7 @@ all the existing types could implement `Bound` because very few of them have the
1818
To fix this issue, just remove the super trait:
1919

2020
```
21-
#![feature(optin_builtin_traits)]
21+
#![feature(auto_traits)]
2222
2323
auto trait Bound {} // ok!
2424

compiler/rustc_feature/src/active.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ declare_features! (
149149
/// Allows using the `#[linkage = ".."]` attribute.
150150
(active, linkage, "1.0.0", Some(29603), None),
151151

152-
/// Allows features specific to OIBIT (auto traits).
153-
(active, optin_builtin_traits, "1.0.0", Some(13231), None),
154-
155152
/// Allows using `box` in patterns (RFC 469).
156153
(active, box_patterns, "1.0.0", Some(29641), None),
157154

@@ -215,6 +212,10 @@ declare_features! (
215212
/// purpose as `#[allow_internal_unstable]`.
216213
(active, rustc_allow_const_fn_unstable, "1.49.0", Some(69399), None),
217214

215+
/// Allows features specific to auto traits.
216+
/// Renamed from `optin_builtin_traits`.
217+
(active, auto_traits, "1.50.0", Some(13231), None),
218+
218219
// no-tracking-issue-end
219220

220221
// -------------------------------------------------------------------------

compiler/rustc_feature/src/removed.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ declare_features! (
7171
/// Allows using custom attributes (RFC 572).
7272
(removed, custom_attribute, "1.0.0", Some(29642), None,
7373
Some("removed in favor of `#![register_tool]` and `#![register_attr]`")),
74+
/// Allows features specific to OIBIT (now called auto traits).
75+
/// Renamed to `auto_traits`.
76+
(removed, optin_builtin_traits, "1.0.0", Some(13231), None,
77+
Some("renamed to `auto_traits`")),
7478
(removed, pushpop_unsafe, "1.2.0", None, None, None),
7579
(removed, needs_allocator, "1.4.0", Some(27389), None,
7680
Some("subsumed by `#![feature(allocator_internals)]`")),
@@ -113,7 +117,6 @@ declare_features! (
113117
Some("removed in favor of `#![feature(marker_trait_attr)]`")),
114118
/// Allows `#[no_debug]`.
115119
(removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")),
116-
117120
/// Allows comparing raw pointers during const eval.
118121
(removed, const_compare_raw_pointers, "1.46.0", Some(53020), None,
119122
Some("cannot be allowed in const eval in any meaningful way")),

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ pub struct LocalDecl<'tcx> {
811811
/// after typeck.
812812
///
813813
/// This should be sound because the drop flags are fully algebraic, and
814-
/// therefore don't affect the OIBIT or outlives properties of the
814+
/// therefore don't affect the auto-trait or outlives properties of the
815815
/// generator.
816816
pub internal: bool,
817817

0 commit comments

Comments
 (0)