2023-04-25 05:47:05 +00:00
|
|
|
#![feature(negative_bounds, associated_type_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
|
|
|
|
|
2023-12-27 17:57:19 +01:00
|
|
|
fn test5<T>() where T: !Fn() -> i32 {}
|
|
|
|
//~^ ERROR parenthetical notation may not be used for negative bounds
|
|
|
|
|
2023-04-25 05:47:05 +00:00
|
|
|
fn main() {}
|