Open apopiak opened 3 years ago
Didn't you mean to write?
impl<T: Trait> A<T>
where
(T::AccountId, T::AccountId): Default,
{
fn foo() -> Self {
A::_C(Default::default())
}
}
That seems more like what was intended here and it compiles.
This appears to be fixed-by-next-solver, but I don't think I can add that label.
Didn't you mean to write?
impl<T: Trait> A<T> where (T::AccountId, T::AccountId): Default, { fn foo() -> Self { A::_C(Default::default()) } }
Nope, the bug is specifically about the compiler getting confused by the useless/superfluous (at least with this particular simplified code example) where clause that should not have any impact on the compilation. It is a reduced version of real life code IIRC (it's been a while 😅 ) that might be generated.
The following code does not compile (playground link):
I expected to see this happen: Successful compilation
Instead, this happened: I get
E0271
Ways to get this to compile (that shouldn't matter/don't change the semantics):
where
bound<(T::AccountId, T::AccountId)>::default()
Meta
rustc --version --verbose
:(also happens on 1.52-nightly)