Files
rust/tests/ui/const-generics/associated_const_equality/unconstrained_impl_param.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
603 B
Rust
Raw Normal View History

2025-05-01 15:46:33 +01:00
// regression test for #137813 where we would assume all constants in the type system
// cannot contain inference variables, even though associated const equality syntax
// was still lowered without the feature gate enabled.
trait AssocConst {
const A: u8;
}
impl<T> AssocConst for (T,) {
const A: u8 = 0;
}
trait Trait {}
impl<U> Trait for () where (U,): AssocConst<A = { 0 }> {}
//~^ ERROR associated const equality is incomplete
//~| ERROR the type parameter `U` is not constrained by the impl trait
fn foo()
where
(): Trait,
//~^ ERROR type mismatch resolving
{
}
2025-05-01 16:22:31 +01:00
fn main() {}