Use the name "auto traits" everywhere in the compiler
Goodbye, OIBIT!
This commit is contained in:
parent
810324d1f3
commit
82dc99ba7a
10 changed files with 20 additions and 20 deletions
|
@ -811,7 +811,7 @@ pub struct LocalDecl<'tcx> {
|
||||||
/// after typeck.
|
/// after typeck.
|
||||||
///
|
///
|
||||||
/// This should be sound because the drop flags are fully algebraic, and
|
/// 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.
|
/// generator.
|
||||||
pub internal: bool,
|
pub internal: bool,
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ pub enum Reveal {
|
||||||
/// be observable directly by the user, `Reveal::All`
|
/// be observable directly by the user, `Reveal::All`
|
||||||
/// should not be used by checks which may expose
|
/// should not be used by checks which may expose
|
||||||
/// type equality or type contents to the user.
|
/// 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
|
/// transmute-checking, which expose some details, but
|
||||||
/// not the whole concrete type of the `impl Trait`.
|
/// not the whole concrete type of the `impl Trait`.
|
||||||
All,
|
All,
|
||||||
|
|
|
@ -96,7 +96,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
ExprKind::Box { value } => {
|
ExprKind::Box { value } => {
|
||||||
let value = this.hir.mirror(value);
|
let value = this.hir.mirror(value);
|
||||||
// The `Box<T>` temporary created here is not a part of the HIR,
|
// 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`.
|
// determination. See the comment about `box` at `yield_in_scope`.
|
||||||
let result = this.local_decls.push(LocalDecl::new(expr.ty, expr_span).internal());
|
let result = this.local_decls.push(LocalDecl::new(expr.ty, expr_span).internal());
|
||||||
this.cfg.push(
|
this.cfg.push(
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#![feature(auto_traits)]
|
#![feature(auto_traits)]
|
||||||
|
|
||||||
pub auto trait AnOibit {}
|
pub auto trait AnAutoTrait {}
|
||||||
|
|
|
@ -12,9 +12,9 @@ pub struct Bar<T> { t: T }
|
||||||
// full impl string. Instead, just make sure something from each part
|
// full impl string. Instead, just make sure something from each part
|
||||||
// is mentioned.
|
// 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 - Send
|
||||||
// @has - !AnOibit
|
// @has - !AnAutoTrait
|
||||||
// @has - Copy
|
// @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 {}
|
where T: Copy {}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
#![feature(negative_impls)]
|
#![feature(negative_impls)]
|
||||||
#![feature(auto_traits)]
|
#![feature(auto_traits)]
|
||||||
|
|
||||||
pub auto trait AnOibit {}
|
pub auto trait AnAutoTrait {}
|
||||||
|
|
||||||
pub struct Foo<T> { field: T }
|
pub struct Foo<T> { field: T }
|
||||||
|
|
||||||
// @has impl_parts/struct.Foo.html '//*[@class="impl"]//code' \
|
// @has impl_parts/struct.Foo.html '//*[@class="impl"]//code' \
|
||||||
// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync,"
|
// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
|
||||||
// @has impl_parts/trait.AnOibit.html '//*[@class="item-list"]//code' \
|
// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//code' \
|
||||||
// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync,"
|
// "impl<T: Clone> !AnAutoTrait 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 {}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Ensure that OIBIT checks `T` when it encounters a `PhantomData<T>` field, instead of checking
|
// Ensure that auto trait checks `T` when it encounters a `PhantomData<T>` field, instead of
|
||||||
// the `PhantomData<T>` type itself (which almost always implements an auto trait)
|
// checking the `PhantomData<T>` type itself (which almost always implements an auto trait).
|
||||||
|
|
||||||
#![feature(auto_traits)]
|
#![feature(auto_traits)]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0277]: `T` cannot be shared between threads safely
|
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) {}
|
LL | fn is_zen<T: Zen>(_: T) {}
|
||||||
| --- required by this bound in `is_zen`
|
| --- 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
|
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) {}
|
LL | fn is_zen<T: Zen>(_: T) {}
|
||||||
| --- required by this bound in `is_zen`
|
| --- required by this bound in `is_zen`
|
|
@ -1,5 +1,5 @@
|
||||||
// OIBIT-based version of #29859, supertrait version. Test that using
|
// Auto-trait-based version of #29859, supertrait version. Test that using
|
||||||
// a simple OIBIT `..` impl alone still doesn't allow arbitrary bounds
|
// a simple auto trait `..` impl alone still doesn't allow arbitrary bounds
|
||||||
// to be synthesized.
|
// to be synthesized.
|
||||||
|
|
||||||
#![feature(auto_traits)]
|
#![feature(auto_traits)]
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0568]: auto traits cannot have super traits
|
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 {}
|
LL | auto trait Magic: Copy {}
|
||||||
| ----- ^^^^ help: remove the super traits
|
| ----- ^^^^ help: remove the super traits
|
||||||
|
@ -7,7 +7,7 @@ LL | auto trait Magic: Copy {}
|
||||||
| auto trait cannot have super traits
|
| auto trait cannot have super traits
|
||||||
|
|
||||||
error[E0277]: the trait bound `NoClone: Copy` is not satisfied
|
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) }
|
LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
|
||||||
| ----- required by this bound in `copy`
|
| ----- required by this bound in `copy`
|
Loading…
Add table
Add a link
Reference in a new issue