about summary refs log tree commit diff
path: root/tests/ui/traits/negative-impls/negated-auto-traits-validity.rs
blob: 76996b5593e60d7b73ad5e4de91fb52dded7beb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//@ check-pass

#![feature(auto_traits, negative_impls)]

auto trait Foo {}
auto trait Bar {}

struct NeedsOutlives<'a, T>(&'a T);

impl<'a, T: 'a> !Foo for NeedsOutlives<'a, T> {}

// Leaving out the lifetime bound
impl<'a, T> !Bar for NeedsOutlives<'a, T> {}

struct NeedsSend<T: Send>(T);

impl<T: Send> !Foo for NeedsSend<T> {}

// Leaving off the trait bound
impl<T> !Bar for NeedsSend<T> {}

fn main() {}