mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 09:32:42 +00:00
trait-system: Recover deferred closure calls after errors fixes rust-lang/rust#157951 this already reported the right errors, then typeck kept going and hit the deferred closure call path. that path assumed it could always find a fn trait impl after closure kind inference. with this repro, the earlier errors mean that lookup can fail, so it should recover instead of iceing. i think keeping this as recovery is the least surprising fix here. the compiler has already told the user what's wrong, so turning the later invariant into another hard failure doesn't buy much. also drops the weird e0746 help for this closure case. there's no written ret ty to edit, so suggestions like \impl f\ or \ox<dyn box::new(f)>\ were just noise. added the next-solver ui test for the repro.