Use the name "auto traits" everywhere in the compiler

Goodbye, OIBIT!
This commit is contained in:
Camelid 2020-11-24 15:44:04 -08:00
parent 810324d1f3
commit 82dc99ba7a
10 changed files with 20 additions and 20 deletions

View File

@ -811,7 +811,7 @@ pub struct LocalDecl<'tcx> {
/// after typeck.
///
/// This should be sound because the drop flags are fully algebraic, and
/// therefore don't affect the OIBIT or outlives properties of the
/// therefore don't affect the auto-trait or outlives properties of the
/// generator.
pub internal: bool,

View File

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

View File

@ -96,7 +96,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
ExprKind::Box { value } => {
let value = this.hir.mirror(value);
// The `Box<T>` temporary created here is not a part of the HIR,
// and therefore is not considered during generator OIBIT
// and therefore is not considered during generator auto-trait
// determination. See the comment about `box` at `yield_in_scope`.
let result = this.local_decls.push(LocalDecl::new(expr.ty, expr_span).internal());
this.cfg.push(

View File

@ -1,3 +1,3 @@
#![feature(auto_traits)]
pub auto trait AnOibit {}
pub auto trait AnAutoTrait {}

View File

@ -12,9 +12,9 @@ pub struct Bar<T> { t: T }
// full impl string. Instead, just make sure something from each part
// is mentioned.
// @has implementors/rustdoc_impl_parts_crosscrate/trait.AnOibit.js Bar
// @has implementors/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar
// @has - Send
// @has - !AnOibit
// @has - !AnAutoTrait
// @has - Copy
impl<T: Send> !rustdoc_impl_parts_crosscrate::AnOibit for Bar<T>
impl<T: Send> !rustdoc_impl_parts_crosscrate::AnAutoTrait for Bar<T>
where T: Copy {}

View File

@ -1,12 +1,12 @@
#![feature(negative_impls)]
#![feature(auto_traits)]
pub auto trait AnOibit {}
pub auto trait AnAutoTrait {}
pub struct Foo<T> { field: T }
// @has impl_parts/struct.Foo.html '//*[@class="impl"]//code' \
// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync,"
// @has impl_parts/trait.AnOibit.html '//*[@class="item-list"]//code' \
// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync,"
impl<T: Clone> !AnOibit for Foo<T> where T: Sync {}
// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//code' \
// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync {}

View File

@ -1,5 +1,5 @@
// Ensure that OIBIT checks `T` when it encounters a `PhantomData<T>` field, instead of checking
// the `PhantomData<T>` type itself (which almost always implements an auto trait)
// Ensure that auto trait checks `T` when it encounters a `PhantomData<T>` field, instead of
// checking the `PhantomData<T>` type itself (which almost always implements an auto trait).
#![feature(auto_traits)]

View File

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

View File

@ -1,5 +1,5 @@
// OIBIT-based version of #29859, supertrait version. Test that using
// a simple OIBIT `..` impl alone still doesn't allow arbitrary bounds
// Auto-trait-based version of #29859, supertrait version. Test that using
// a simple auto trait `..` impl alone still doesn't allow arbitrary bounds
// to be synthesized.
#![feature(auto_traits)]

View File

@ -1,5 +1,5 @@
error[E0568]: auto traits cannot have super traits
--> $DIR/traits-inductive-overflow-supertrait-oibit.rs:8:19
--> $DIR/traits-inductive-overflow-supertrait-auto-trait.rs:8:19
|
LL | auto trait Magic: Copy {}
| ----- ^^^^ help: remove the super traits
@ -7,7 +7,7 @@ LL | auto trait Magic: Copy {}
| auto trait cannot have super traits
error[E0277]: the trait bound `NoClone: Copy` is not satisfied
--> $DIR/traits-inductive-overflow-supertrait-oibit.rs:16:23
--> $DIR/traits-inductive-overflow-supertrait-auto-trait.rs:16:23
|
LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
| ----- required by this bound in `copy`