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:
Niko Matsakis 2020-01-09 05:56:38 -05:00
parent 65071708f8
commit fda3378e3f
102 changed files with 330 additions and 111 deletions

View file

@ -1,4 +1,4 @@
#![feature(optin_builtin_traits)]
#![feature(negative_impls)]
use std::marker::Sync;

View file

@ -1,6 +1,7 @@
//~ ERROR
#![feature(optin_builtin_traits)]
#![feature(negative_impls)]
unsafe auto trait Trait {
type Output; //~ ERROR E0380

View file

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

View file

@ -1,4 +1,5 @@
#![feature(optin_builtin_traits)]
#![feature(negative_impls)]
unsafe auto trait Trait {
fn method(&self) { //~ ERROR E0380

View file

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

View file

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

View file

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