Files
rust/tests/ui/trait-bounds/maybe-bound-with-assoc.rs

13 lines
336 B
Rust
Raw Normal View History

2024-10-31 00:09:34 +00:00
trait HasAssoc {
type Assoc;
}
fn hasassoc<T: ?HasAssoc<Assoc = ()>>() {}
//~^ ERROR bound modifier `?` can only be applied to `Sized`
2024-10-31 00:09:34 +00:00
trait NoAssoc {}
fn noassoc<T: ?NoAssoc<Missing = ()>>() {}
//~^ ERROR bound modifier `?` can only be applied to `Sized`
2024-10-31 00:09:34 +00:00
//~| ERROR associated type `Missing` not found for `NoAssoc`
fn main() {}