Skip to content

Commit 82dc99b

Browse files
committed
Use the name "auto traits" everywhere in the compiler
Goodbye, OIBIT!
1 parent 810324d commit 82dc99b

10 files changed

+20
-20
lines changed

compiler/rustc_middle/src/mir/mod.rs

+1-1
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

compiler/rustc_middle/src/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub enum Reveal {
7070
/// be observable directly by the user, `Reveal::All`
7171
/// should not be used by checks which may expose
7272
/// type equality or type contents to the user.
73-
/// There are some exceptions, e.g., around OIBITS and
73+
/// There are some exceptions, e.g., around auto traits and
7474
/// transmute-checking, which expose some details, but
7575
/// not the whole concrete type of the `impl Trait`.
7676
All,

compiler/rustc_mir_build/src/build/expr/as_rvalue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
9696
ExprKind::Box { value } => {
9797
let value = this.hir.mirror(value);
9898
// The `Box<T>` temporary created here is not a part of the HIR,
99-
// and therefore is not considered during generator OIBIT
99+
// and therefore is not considered during generator auto-trait
100100
// determination. See the comment about `box` at `yield_in_scope`.
101101
let result = this.local_decls.push(LocalDecl::new(expr.ty, expr_span).internal());
102102
this.cfg.push(
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#![feature(auto_traits)]
22

3-
pub auto trait AnOibit {}
3+
pub auto trait AnAutoTrait {}

src/test/rustdoc/impl-parts-crosscrate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ pub struct Bar<T> { t: T }
1212
// full impl string. Instead, just make sure something from each part
1313
// is mentioned.
1414

15-
// @has implementors/rustdoc_impl_parts_crosscrate/trait.AnOibit.js Bar
15+
// @has implementors/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar
1616
// @has - Send
17-
// @has - !AnOibit
17+
// @has - !AnAutoTrait
1818
// @has - Copy
19-
impl<T: Send> !rustdoc_impl_parts_crosscrate::AnOibit for Bar<T>
19+
impl<T: Send> !rustdoc_impl_parts_crosscrate::AnAutoTrait for Bar<T>
2020
where T: Copy {}

src/test/rustdoc/impl-parts.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#![feature(negative_impls)]
22
#![feature(auto_traits)]
33

4-
pub auto trait AnOibit {}
4+
pub auto trait AnAutoTrait {}
55

66
pub struct Foo<T> { field: T }
77

88
// @has impl_parts/struct.Foo.html '//*[@class="impl"]//code' \
9-
// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync,"
10-
// @has impl_parts/trait.AnOibit.html '//*[@class="item-list"]//code' \
11-
// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync,"
12-
impl<T: Clone> !AnOibit for Foo<T> where T: Sync {}
9+
// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
10+
// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//code' \
11+
// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
12+
impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync {}

src/test/ui/phantom-oibit.rs renamed to src/test/ui/phantom-auto-trait.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Ensure that OIBIT checks `T` when it encounters a `PhantomData<T>` field, instead of checking
2-
// the `PhantomData<T>` type itself (which almost always implements an auto trait)
1+
// Ensure that auto trait checks `T` when it encounters a `PhantomData<T>` field, instead of
2+
// checking the `PhantomData<T>` type itself (which almost always implements an auto trait).
33

44
#![feature(auto_traits)]
55

src/test/ui/phantom-oibit.stderr renamed to src/test/ui/phantom-auto-trait.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: `T` cannot be shared between threads safely
2-
--> $DIR/phantom-oibit.rs:21:12
2+
--> $DIR/phantom-auto-trait.rs:21:12
33
|
44
LL | fn is_zen<T: Zen>(_: T) {}
55
| --- required by this bound in `is_zen`
@@ -16,7 +16,7 @@ LL | fn not_sync<T: Sync>(x: Guard<T>) {
1616
| ^^^^^^
1717

1818
error[E0277]: `T` cannot be shared between threads safely
19-
--> $DIR/phantom-oibit.rs:26:12
19+
--> $DIR/phantom-auto-trait.rs:26:12
2020
|
2121
LL | fn is_zen<T: Zen>(_: T) {}
2222
| --- required by this bound in `is_zen`

src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.rs renamed to src/test/ui/traits/traits-inductive-overflow-supertrait-auto-trait.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// OIBIT-based version of #29859, supertrait version. Test that using
2-
// a simple OIBIT `..` impl alone still doesn't allow arbitrary bounds
1+
// Auto-trait-based version of #29859, supertrait version. Test that using
2+
// a simple auto trait `..` impl alone still doesn't allow arbitrary bounds
33
// to be synthesized.
44

55
#![feature(auto_traits)]

src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.stderr renamed to src/test/ui/traits/traits-inductive-overflow-supertrait-auto-trait.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0568]: auto traits cannot have super traits
2-
--> $DIR/traits-inductive-overflow-supertrait-oibit.rs:8:19
2+
--> $DIR/traits-inductive-overflow-supertrait-auto-trait.rs:8:19
33
|
44
LL | auto trait Magic: Copy {}
55
| ----- ^^^^ help: remove the super traits
66
| |
77
| auto trait cannot have super traits
88

99
error[E0277]: the trait bound `NoClone: Copy` is not satisfied
10-
--> $DIR/traits-inductive-overflow-supertrait-oibit.rs:16:23
10+
--> $DIR/traits-inductive-overflow-supertrait-auto-trait.rs:16:23
1111
|
1212
LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
1313
| ----- required by this bound in `copy`

0 commit comments

Comments
 (0)