Open phynalle opened 1 year ago
I found out that adding static bound (e.g. impl<T: Foo + 'static> ...
) fixes the compile error.
but I don't know which code is correct.
Regression in nightly-2022-09-22 from #100096. While that PR fixed a soundness hole, I don't think it was expected to affect stable code. CC @compiler-errors, @jackh726, @estebank.
Ugh, yeah, this is probably due to the fact we need to prove something like for<'a> Self: 'a
on the GAT in order to prove that for<'a> T::Gat<'a>: Sized
@rustbot label -regression-untriaged +regression-from-stable-to-stable
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-high
I'm split on what we should do here. There's really two options (because I fix is some time away): 1) Revert #100096 2) Deal with it
A decent middle ground would be to extend the "this might be a bug" error to this case.
Deal with it
That would require the error to at least suggest the 'static
bound to unblock people.
Code
I tried this code:
Version it worked on
The code is compiled on Rust 1.65
Version with regression
The code is not compiled on current stable(1.66), beta, and nightly with error: