diff options
Diffstat (limited to 'tests/ui/auto-traits/typeck-default-trait-impl-constituent-types.rs')
-rw-r--r-- | tests/ui/auto-traits/typeck-default-trait-impl-constituent-types.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/auto-traits/typeck-default-trait-impl-constituent-types.rs b/tests/ui/auto-traits/typeck-default-trait-impl-constituent-types.rs new file mode 100644 index 000000000..73ff46d05 --- /dev/null +++ b/tests/ui/auto-traits/typeck-default-trait-impl-constituent-types.rs @@ -0,0 +1,23 @@ +#![feature(auto_traits)] +#![feature(negative_impls)] + +auto trait MyTrait {} + +impl<T> !MyTrait for *mut T {} + +struct MyS; + +struct MyS2; + +impl !MyTrait for MyS2 {} + +struct MyS3; + +fn is_mytrait<T: MyTrait>() {} + +fn main() { + is_mytrait::<MyS>(); + + is_mytrait::<MyS2>(); + //~^ ERROR `MyS2: MyTrait` is not satisfied +} |