rust/tests/ui/const-generics/backcompat/trait-resolution-breakage.rs
2023-01-11 09:32:08 +00:00

19 lines
295 B
Rust

// check-pass
trait Trait<T> {
const ASSOC_CONST: usize = 0;
}
impl Trait<()> for u8 {}
// `u8::ASSOC_CONST` is resolved today, but will be ambiguous
// under lazy normalization.
fn foo<T, U>() -> [(T, U); u8::ASSOC_CONST]
where
u8: Trait<T> + Trait<U>,
{
todo!()
}
fn main() {}