rust/tests/ui/trait-bounds/maybe-bound-with-assoc.rs
2024-10-31 00:09:52 +00:00

13 lines
284 B
Rust

trait HasAssoc {
type Assoc;
}
fn hasassoc<T: ?HasAssoc<Assoc = ()>>() {}
//~^ WARN relaxing a default bound
trait NoAssoc {}
fn noassoc<T: ?NoAssoc<Missing = ()>>() {}
//~^ WARN relaxing a default bound
//~| ERROR associated type `Missing` not found for `NoAssoc`
fn main() {}