1
Fork 0

Auto merge of #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)
This commit is contained in:
bors 2020-11-25 07:25:19 +00:00
commit ec039bd075
60 changed files with 98 additions and 82 deletions

View file

@ -370,7 +370,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
ast::ItemKind::Trait(ast::IsAuto::Yes, ..) => { ast::ItemKind::Trait(ast::IsAuto::Yes, ..) => {
gate_feature_post!( gate_feature_post!(
&self, &self,
optin_builtin_traits, auto_traits,
i.span, i.span,
"auto traits are experimental and possibly buggy" "auto traits are experimental and possibly buggy"
); );

View file

@ -1,6 +1,6 @@
#![feature( #![feature(
no_core, lang_items, intrinsics, unboxed_closures, type_ascription, extern_types, 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, thread_local,
)] )]
#![no_core] #![no_core]

View file

@ -15,7 +15,8 @@
#![feature(fn_traits)] #![feature(fn_traits)]
#![feature(int_bits_const)] #![feature(int_bits_const)]
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(optin_builtin_traits)] #![cfg_attr(bootstrap, feature(optin_builtin_traits))]
#![cfg_attr(not(bootstrap), feature(auto_traits))]
#![feature(nll)] #![feature(nll)]
#![feature(allow_internal_unstable)] #![feature(allow_internal_unstable)]
#![feature(hash_raw_entry)] #![feature(hash_raw_entry)]

View file

@ -16,7 +16,7 @@ unsafe.
This will compile: This will compile:
```ignore (ignore auto_trait future compatibility warning) ```ignore (ignore auto_trait future compatibility warning)
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
struct Foo; struct Foo;

View file

@ -4,7 +4,7 @@ or enum type.
Erroneous code example: Erroneous code example:
```compile_fail,E0321 ```compile_fail,E0321
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
struct Foo; struct Foo;

View file

@ -3,7 +3,7 @@ Generics have been used on an auto trait.
Erroneous code example: Erroneous code example:
```compile_fail,E0567 ```compile_fail,E0567
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
auto trait Generic<T> {} // error! auto trait Generic<T> {} // error!
# fn main() {} # fn main() {}
@ -16,7 +16,7 @@ parameters.
To fix this issue, just remove the generics: To fix this issue, just remove the generics:
``` ```
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
auto trait Generic {} // ok! auto trait Generic {} // ok!
# fn main() {} # fn main() {}

View file

@ -3,7 +3,7 @@ A super trait has been added to an auto trait.
Erroneous code example: Erroneous code example:
```compile_fail,E0568 ```compile_fail,E0568
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
auto trait Bound : Copy {} // error! 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: To fix this issue, just remove the super trait:
``` ```
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
auto trait Bound {} // ok! auto trait Bound {} // ok!

View file

@ -149,9 +149,6 @@ declare_features! (
/// Allows using the `#[linkage = ".."]` attribute. /// Allows using the `#[linkage = ".."]` attribute.
(active, linkage, "1.0.0", Some(29603), None), (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). /// Allows using `box` in patterns (RFC 469).
(active, box_patterns, "1.0.0", Some(29641), None), (active, box_patterns, "1.0.0", Some(29641), None),
@ -215,6 +212,10 @@ declare_features! (
/// purpose as `#[allow_internal_unstable]`. /// purpose as `#[allow_internal_unstable]`.
(active, rustc_allow_const_fn_unstable, "1.49.0", Some(69399), None), (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 // no-tracking-issue-end
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------

View file

@ -71,6 +71,10 @@ declare_features! (
/// Allows using custom attributes (RFC 572). /// Allows using custom attributes (RFC 572).
(removed, custom_attribute, "1.0.0", Some(29642), None, (removed, custom_attribute, "1.0.0", Some(29642), None,
Some("removed in favor of `#![register_tool]` and `#![register_attr]`")), 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, pushpop_unsafe, "1.2.0", None, None, None),
(removed, needs_allocator, "1.4.0", Some(27389), None, (removed, needs_allocator, "1.4.0", Some(27389), None,
Some("subsumed by `#![feature(allocator_internals)]`")), Some("subsumed by `#![feature(allocator_internals)]`")),
@ -113,7 +117,6 @@ declare_features! (
Some("removed in favor of `#![feature(marker_trait_attr)]`")), Some("removed in favor of `#![feature(marker_trait_attr)]`")),
/// Allows `#[no_debug]`. /// Allows `#[no_debug]`.
(removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")), (removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")),
/// Allows comparing raw pointers during const eval. /// Allows comparing raw pointers during const eval.
(removed, const_compare_raw_pointers, "1.46.0", Some(53020), None, (removed, const_compare_raw_pointers, "1.46.0", Some(53020), None,
Some("cannot be allowed in const eval in any meaningful way")), Some("cannot be allowed in const eval in any meaningful way")),

View file

@ -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,

View file

@ -71,7 +71,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,

View file

@ -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(

View file

@ -285,6 +285,7 @@ symbols! {
attr_literals, attr_literals,
attributes, attributes,
augmented_assignments, augmented_assignments,
auto_traits,
automatically_derived, automatically_derived,
avx512_target_feature, avx512_target_feature,
await_macro, await_macro,

View file

@ -112,7 +112,8 @@
#![feature(never_type)] #![feature(never_type)]
#![feature(nll)] #![feature(nll)]
#![feature(nonnull_slice_from_raw_parts)] #![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(or_patterns)]
#![feature(pattern)] #![feature(pattern)]
#![feature(ptr_internals)] #![feature(ptr_internals)]

View file

@ -117,7 +117,8 @@
#![feature(nll)] #![feature(nll)]
#![feature(exhaustive_patterns)] #![feature(exhaustive_patterns)]
#![feature(no_core)] #![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(or_patterns)]
#![feature(prelude_import)] #![feature(prelude_import)]
#![feature(repr_simd, platform_intrinsics)] #![feature(repr_simd, platform_intrinsics)]

View file

@ -28,7 +28,8 @@
#![feature(extern_types)] #![feature(extern_types)]
#![feature(in_band_lifetimes)] #![feature(in_band_lifetimes)]
#![feature(negative_impls)] #![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(restricted_std)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![feature(min_specialization)] #![feature(min_specialization)]

View file

@ -9,10 +9,13 @@
// headers or footers. // headers or footers.
// //
// Note that the actual module entry point is located in the C runtime startup // 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). // 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"] #![crate_type = "rlib"]
#![no_core] #![no_core]
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]

View file

@ -1,6 +1,9 @@
// See rsbegin.rs for details. // 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"] #![crate_type = "rlib"]
#![no_core] #![no_core]

View file

@ -286,7 +286,8 @@
#![feature(nll)] #![feature(nll)]
#![feature(nonnull_slice_from_raw_parts)] #![feature(nonnull_slice_from_raw_parts)]
#![feature(once_cell)] #![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(or_patterns)]
#![feature(panic_info_message)] #![feature(panic_info_message)]
#![feature(panic_internals)] #![feature(panic_internals)]

View file

@ -1,4 +1,4 @@
# `optin_builtin_traits` # `auto_traits`
The tracking issue for this feature is [#13231] 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 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, that are automatically implemented for every type, unless the type, or a type it contains,
@ -24,7 +24,7 @@ Example:
```rust ```rust
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
auto trait Valid {} auto trait Valid {}

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
// pp-exact // pp-exact

View file

@ -2,7 +2,7 @@
#![crate_type = "lib"] #![crate_type = "lib"]
// we can compile to a variety of platforms, because we don't need // we can compile to a variety of platforms, because we don't need
// cross-compiled standard libraries. // cross-compiled standard libraries.
#![feature(no_core, optin_builtin_traits)] #![feature(no_core, auto_traits)]
#![no_core] #![no_core]
#![feature(repr_simd, simd_ffi, link_llvm_intrinsics, lang_items, rustc_attrs)] #![feature(repr_simd, simd_ffi, link_llvm_intrinsics, lang_items, rustc_attrs)]

View file

@ -1,4 +1,4 @@
#![feature(lang_items, no_core, optin_builtin_traits)] #![feature(lang_items, no_core, auto_traits)]
#![no_core] #![no_core]
#[lang="copy"] #[lang="copy"]

View file

@ -1,6 +1,6 @@
// aux-build:auto-traits.rs // aux-build:auto-traits.rs
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![crate_name = "foo"] #![crate_name = "foo"]

View file

@ -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' // @has auto_aliases/trait.Bar.html '//h3[@aliases="auto_aliases::Foo"]' 'impl Bar for Foo'
pub struct Foo; pub struct Foo;

View file

@ -1,3 +1,3 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
pub unsafe auto trait Bar {} pub unsafe auto trait Bar {}

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
pub mod bar { pub mod bar {
use std::marker; use std::marker;

View file

@ -1,3 +1,3 @@
#![feature(optin_builtin_traits)] #![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 // 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 {}

View file

@ -1,12 +1,12 @@
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(optin_builtin_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 {}

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
pub auto trait Banana {} pub auto trait Banana {}

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
// edition:2018 // edition:2018

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
auto trait Generic<T> {} auto trait Generic<T> {}
//~^ auto traits cannot have generic parameters [E0567] //~^ auto traits cannot have generic parameters [E0567]

View file

@ -1,6 +1,6 @@
// run-pass // run-pass
#![allow(unused_doc_comments)] #![allow(unused_doc_comments)]
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait Auto {} auto trait Auto {}

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
unsafe auto trait Trait { unsafe auto trait Trait {

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
unsafe auto trait Trait { unsafe auto trait Trait {

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait Magic : Sized where Option<Self> : Magic {} //~ ERROR E0568 auto trait Magic : Sized where Option<Self> : Magic {} //~ ERROR E0568

View file

@ -22,7 +22,7 @@
// println!("{:?} {:?}", a, b); // println!("{:?} {:?}", a, b);
// } // }
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait Magic: Copy {} //~ ERROR E0568 auto trait Magic: Copy {} //~ ERROR E0568

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait MyTrait {} auto trait MyTrait {}

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait MyTrait {} auto trait MyTrait {}

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait MyTrait {} auto trait MyTrait {}

View file

@ -3,7 +3,7 @@
// other words, the auto impl only applies if there are no existing // other words, the auto impl only applies if there are no existing
// impls whose types unify. // impls whose types unify.
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait Defaulted { } auto trait Defaulted { }

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait MySafeTrait {} auto trait MySafeTrait {}

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
// Test for issue #56934 - that it is impossible to redundantly // Test for issue #56934 - that it is impossible to redundantly

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
// Test for issue #56934 - that it is impossible to redundantly // Test for issue #56934 - that it is impossible to redundantly

View file

@ -1,5 +1,5 @@
// Test that default and negative trait implementations are gated by // Test that default and negative trait implementations are gated by
// `optin_builtin_traits` feature gate // `auto_traits` feature gate
struct DummyStruct; struct DummyStruct;

View file

@ -1,14 +1,14 @@
error[E0658]: auto traits are experimental and possibly buggy 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 {} LL | auto trait AutoDummyTrait {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information = note: see issue #13231 <https://github.com/rust-lang/rust/issues/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 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 {} LL | impl !AutoDummyTrait for DummyStruct {}
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^

View file

@ -1,5 +1,5 @@
#![feature(generators)] #![feature(generators)]
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait Foo {} auto trait Foo {}

View file

@ -1,5 +1,5 @@
// check-pass // check-pass
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait NotSame {} auto trait NotSame {}

View file

@ -1,6 +1,6 @@
// check-pass // check-pass
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
#![allow(bare_trait_objects)] #![allow(bare_trait_objects)]

View file

@ -1,7 +1,7 @@
// 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(optin_builtin_traits)] #![feature(auto_traits)]
use std::marker::{PhantomData}; use std::marker::{PhantomData};

View file

@ -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`

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
#[allow(private_in_public)] #[allow(private_in_public)]

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
pub trait PubPrincipal {} pub trait PubPrincipal {}

View file

@ -1,6 +1,6 @@
// Make sure specialization cannot change impl polarity // Make sure specialization cannot change impl polarity
#![feature(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete #![feature(specialization)] //~ WARN the feature `specialization` is incomplete

View file

@ -6,7 +6,7 @@
//[legacy]normalize-stderr-32bit: "hee444285569b39c2" -> "SYMBOL_HASH" //[legacy]normalize-stderr-32bit: "hee444285569b39c2" -> "SYMBOL_HASH"
//[legacy]normalize-stderr-64bit: "h310ea0259fc3d32d" -> "SYMBOL_HASH" //[legacy]normalize-stderr-64bit: "h310ea0259fc3d32d" -> "SYMBOL_HASH"
#![feature(optin_builtin_traits, rustc_attrs)] #![feature(auto_traits, rustc_attrs)]
#![allow(dead_code)] #![allow(dead_code)]
mod foo { mod foo {

View file

@ -1,8 +1,8 @@
// 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(optin_builtin_traits)] #![feature(auto_traits)]
#![feature(negative_impls)] #![feature(negative_impls)]
auto trait Magic: Copy {} //~ ERROR E0568 auto trait Magic: Copy {} //~ ERROR E0568

View file

@ -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`

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits, core)] #![feature(auto_traits, core)]
#![crate_type = "rlib"] #![crate_type = "rlib"]
pub auto trait DefaultedTrait { } pub auto trait DefaultedTrait { }