introduce negative_impls feature gate and document
They used to be covered by `optin_builtin_traits` but negative impls are now applicable to all traits, not just auto traits. This also adds docs in the unstable book for the current state of auto traits.
This commit is contained in:
parent
65071708f8
commit
fda3378e3f
102 changed files with 330 additions and 111 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(optin_builtin_traits)]
|
||||
#![feature(negative_impls)]
|
||||
|
||||
use std::marker::Sync;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
//~ ERROR
|
||||
|
||||
#![feature(optin_builtin_traits)]
|
||||
#![feature(negative_impls)]
|
||||
|
||||
unsafe auto trait Trait {
|
||||
type Output; //~ ERROR E0380
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0380]: auto traits cannot have methods or associated items
|
||||
--> $DIR/issue-23080-2.rs:6:10
|
||||
--> $DIR/issue-23080-2.rs:7:10
|
||||
|
|
||||
LL | unsafe auto trait Trait {
|
||||
| ----- auto trait cannot have items
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#![feature(optin_builtin_traits)]
|
||||
#![feature(negative_impls)]
|
||||
|
||||
unsafe auto trait Trait {
|
||||
fn method(&self) { //~ ERROR E0380
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0380]: auto traits cannot have methods or associated items
|
||||
--> $DIR/issue-23080.rs:4:8
|
||||
--> $DIR/issue-23080.rs:5:8
|
||||
|
|
||||
LL | unsafe auto trait Trait {
|
||||
| ----- auto trait cannot have items
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// check-pass
|
||||
#![feature(optin_builtin_traits)]
|
||||
#![feature(negative_impls)]
|
||||
|
||||
auto trait NotSame {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(optin_builtin_traits)]
|
||||
#![feature(negative_impls)]
|
||||
#![allow(order_dependent_trait_objects)]
|
||||
|
||||
// Check that the issue #33140 hack does not allow unintended things.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue