os-rust/tests/ui/traits/negative-bounds/associated-constraints.rs
2023-12-28 00:43:35 +01:00

19 lines
551 B
Rust

#![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
fn main() {}