Open hlb8122 opened 3 years ago
Looking at logs, this looks really similar to #87755 (or more so impl-wf-cycle-1.rs
)
We try to project <F as std::ops::FnOnce<(<Structure<F> as Trait>::Gat<'a>,)>>
That requires us to prove that Structure<F>: Trait
So we match against <Structure<_#0t> as Trait>
So we have to prove that <_#0t as std::ops::FnOnce<(<Structure<F> as Trait>::Gat<'a>,)>>
And we end up in a cycle where match_impl
continues to use a new type var
@jackh726 You can also stall it like this https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e3ff465815d5621c29ec242951ade429
Un-GATed, this would also cause an overflow https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=d1ce6b3a5e256f61f74476662a88bc8c
GATs issue triage: not blocking. Not strictly a GATs issue; you can run into similar problems with a where clause on the trait itself (as showed in the previous comment). Unfortunate, but a larger class of issues.
I tried this code:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=fbd726c1f1bd90e514358a91016581ec
Given that https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f889ed7bfeffb6a6f3179bf6d94f438c causes an
overflow evaluating the requirement Structure<F>: Trait
I would expect the problem code to give a similar message.Instead,
rustc
stalls indefinitely.Meta
rustc --version --verbose
:Backtrace
No backtrace produced due to stall.