diff options
Diffstat (limited to 'src/test')
9 files changed, 29 insertions, 12 deletions
diff --git a/src/test/ui/coherence/auxiliary/option_future.rs b/src/test/ui/coherence/auxiliary/option_future.rs index f71df1b87fc..067de1cd867 100644 --- a/src/test/ui/coherence/auxiliary/option_future.rs +++ b/src/test/ui/coherence/auxiliary/option_future.rs @@ -1,8 +1,8 @@ #![crate_type = "lib"] #![feature(negative_impls)] #![feature(rustc_attrs)] +#![feature(with_negative_coherence)] pub trait Future {} -#[rustc_with_negative_coherence] impl<E> !Future for Option<E> where E: Sized {} diff --git a/src/test/ui/coherence/coherence-overlap-negate-alias-strict.rs b/src/test/ui/coherence/coherence-overlap-negate-alias-strict.rs index 16ace450b06..c240a183982 100644 --- a/src/test/ui/coherence/coherence-overlap-negate-alias-strict.rs +++ b/src/test/ui/coherence/coherence-overlap-negate-alias-strict.rs @@ -1,6 +1,7 @@ #![feature(negative_impls)] #![feature(rustc_attrs)] #![feature(trait_alias)] +#![feature(with_negative_coherence)] trait A {} trait B {} @@ -8,10 +9,9 @@ trait AB = A + B; impl !A for u32 {} -trait C {} #[rustc_strict_coherence] +trait C {} impl<T: AB> C for T {} -#[rustc_strict_coherence] impl C for u32 {} //~^ ERROR: conflicting implementations of trait `C` for type `u32` [E0119] // FIXME this should work, we should implement an `assemble_neg_candidates` fn diff --git a/src/test/ui/coherence/coherence-overlap-negate-alias-strict.stderr b/src/test/ui/coherence/coherence-overlap-negate-alias-strict.stderr index 5e436223119..30d837a5c50 100644 --- a/src/test/ui/coherence/coherence-overlap-negate-alias-strict.stderr +++ b/src/test/ui/coherence/coherence-overlap-negate-alias-strict.stderr @@ -3,7 +3,6 @@ error[E0119]: conflicting implementations of trait `C` for type `u32` | LL | impl<T: AB> C for T {} | ------------------- first implementation here -LL | #[rustc_strict_coherence] LL | impl C for u32 {} | ^^^^^^^^^^^^^^ conflicting implementation for `u32` diff --git a/src/test/ui/coherence/coherence-overlap-negate-strict.rs b/src/test/ui/coherence/coherence-overlap-negate-strict.rs index b3ae9a7bf78..1021d87ca1b 100644 --- a/src/test/ui/coherence/coherence-overlap-negate-strict.rs +++ b/src/test/ui/coherence/coherence-overlap-negate-strict.rs @@ -3,16 +3,16 @@ #![feature(negative_impls)] #![feature(rustc_attrs)] #![feature(trait_alias)] +#![feature(with_negative_coherence)] trait A {} trait B {} impl !A for u32 {} -trait C {} #[rustc_strict_coherence] +trait C {} impl<T: A + B> C for T {} -#[rustc_strict_coherence] impl C for u32 {} fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-negative-trait2.rs b/src/test/ui/coherence/coherence-overlap-negative-trait2.rs index 1f47b5ba46e..cc8c463b822 100644 --- a/src/test/ui/coherence/coherence-overlap-negative-trait2.rs +++ b/src/test/ui/coherence/coherence-overlap-negative-trait2.rs @@ -4,15 +4,14 @@ // Check that if we promise to not impl what would overlap it doesn't actually overlap #![feature(rustc_attrs)] +#![feature(with_negative_coherence)] extern crate option_future as lib; use lib::Future; trait Termination {} -#[rustc_with_negative_coherence] impl<E> Termination for Option<E> where E: Sized {} -#[rustc_with_negative_coherence] impl<F> Termination for F where F: Future + Sized {} fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-trait-alias.rs b/src/test/ui/coherence/coherence-overlap-trait-alias.rs index 45b2f086305..9d9c76af91d 100644 --- a/src/test/ui/coherence/coherence-overlap-trait-alias.rs +++ b/src/test/ui/coherence/coherence-overlap-trait-alias.rs @@ -1,5 +1,6 @@ #![feature(rustc_attrs)] #![feature(trait_alias)] +#![feature(with_negative_coherence)] trait A {} trait B {} @@ -8,10 +9,9 @@ trait AB = A + B; impl A for u32 {} impl B for u32 {} -trait C {} #[rustc_strict_coherence] +trait C {} impl<T: AB> C for T {} -#[rustc_strict_coherence] impl C for u32 {} //~^ ERROR // FIXME it's giving an ungreat error but unsure if we care given that it's using an internal rustc diff --git a/src/test/ui/coherence/coherence-overlap-trait-alias.stderr b/src/test/ui/coherence/coherence-overlap-trait-alias.stderr index 5b389f24bf1..421c86ee51a 100644 --- a/src/test/ui/coherence/coherence-overlap-trait-alias.stderr +++ b/src/test/ui/coherence/coherence-overlap-trait-alias.stderr @@ -5,11 +5,10 @@ LL | impl C for u32 {} | ^ cannot infer type for type `u32` | note: multiple `impl`s satisfying `u32: C` found - --> $DIR/coherence-overlap-trait-alias.rs:13:1 + --> $DIR/coherence-overlap-trait-alias.rs:14:1 | LL | impl<T: AB> C for T {} | ^^^^^^^^^^^^^^^^^^^ -LL | #[rustc_strict_coherence] LL | impl C for u32 {} | ^^^^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-with_negative_coherence.rs b/src/test/ui/feature-gates/feature-gate-with_negative_coherence.rs new file mode 100644 index 00000000000..d1d0a6a90b8 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-with_negative_coherence.rs @@ -0,0 +1,8 @@ +trait Foo { } + +impl<T: std::ops::DerefMut> Foo for T { } + +impl<T> Foo for &T { } +//~^ ERROR conflicting implementations of trait `Foo` for type `&_` [E0119] + +fn main() { } diff --git a/src/test/ui/feature-gates/feature-gate-with_negative_coherence.stderr b/src/test/ui/feature-gates/feature-gate-with_negative_coherence.stderr new file mode 100644 index 00000000000..05007dafa37 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-with_negative_coherence.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `Foo` for type `&_` + --> $DIR/feature-gate-with_negative_coherence.rs:5:1 + | +LL | impl<T: std::ops::DerefMut> Foo for T { } + | ------------------------------------- first implementation here +LL | +LL | impl<T> Foo for &T { } + | ^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. |
