about summary refs log tree commit diff
path: root/tests/ui/traits/negative-impls/negated-auto-traits-validity-error.rs
blob: cd675a5efd1626dd1ae1f733fb2bf20a6a321ca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![feature(auto_traits, negative_impls)]

auto trait Foo {}

struct AdditionalLt<'a, T>(&'a (), T);
impl<'a, T: 'a> !Foo for AdditionalLt<'a, T> {}
//~^ ERROR `!Foo` impl requires `T: 'a` but the struct it is implemented for does not

struct AdditionalBound<T>(T);
trait Bound {}
impl<T: Bound> !Foo for AdditionalBound<T> {}
//~^ ERROR `!Foo` impl requires `T: Bound` but the struct it is implemented for does not

struct TwoParam<T, U>(T, U);
impl<T> !Foo for TwoParam<T, T> {}
//~^ ERROR `!Foo` impls cannot be specialized

struct ConcreteParam<T>(T);
impl !Foo for ConcreteParam<i32> {}
//~^ ERROR `!Foo` impls cannot be specialized

fn main() {}