about summary refs log tree commit diff
path: root/tests/ui/traits/negative-bounds/associated-constraints.rs
blob: 795e68bb46950686062f526797436d7301f31bb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![feature(negative_bounds)]

trait Trait {
    type Assoc;
}

fn test<T: !Trait<Assoc = i32>>() {}
//~^ ERROR associated type constraints not allowed on negative bounds

fn test2<T>() where T: !Trait<Assoc = i32> {}
//~^ ERROR associated type constraints not allowed on negative bounds

fn test3<T: !Trait<Assoc: Send>>() {}
//~^ ERROR associated type constraints not allowed on negative bounds

fn test4<T>() where T: !Trait<Assoc: Send> {}
//~^ ERROR associated type constraints not allowed on negative bounds

fn test5<T>() where T: !Fn() -> i32 {}
//~^ ERROR parenthetical notation may not be used for negative bounds

fn main() {}