Do not visit impl-trait when looking for self-type elision. by cjgillot · Pull Request #143450 · rust-lang/rust (original) (raw)

The linked ICE happens when self-param lifetime elision triggers on a type that has &Self appear in an APIT.

This PR is the minimal fix: do not attempt to look inside impl-trait. It should be complemented by a more principled fix where we attach the lifetime elision logic to the rib-based resolution logic. This should lead to better error messages for lifetimes that appear in fn(&mut Self). (The current error is "invalid self parameter type".)

Fixes #122903