summaryrefslogtreecommitdiffstats
path: root/tests/ui/auto-traits/typeck-default-trait-impl-constituent-types.rs
blob: 73ff46d05e46645bf5725f0680ebbaecc6eccd09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
}