diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/coherence/auxiliary/option_future.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/coherence/coherence-overlap-negative-trait2.rs | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/coherence/auxiliary/option_future.rs b/src/test/ui/coherence/auxiliary/option_future.rs new file mode 100644 index 00000000000..f71df1b87fc --- /dev/null +++ b/src/test/ui/coherence/auxiliary/option_future.rs @@ -0,0 +1,8 @@ +#![crate_type = "lib"] +#![feature(negative_impls)] +#![feature(rustc_attrs)] + +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-negative-trait2.rs b/src/test/ui/coherence/coherence-overlap-negative-trait2.rs new file mode 100644 index 00000000000..1f47b5ba46e --- /dev/null +++ b/src/test/ui/coherence/coherence-overlap-negative-trait2.rs @@ -0,0 +1,18 @@ +// check-pass +// aux-build:option_future.rs +// +// Check that if we promise to not impl what would overlap it doesn't actually overlap + +#![feature(rustc_attrs)] + +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() {} |
