mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 13:05:18 +03:00
01cccf92dc
Avoid ICE when suggesting as_ref for ill-typed closure receivers Fixes rust-lang/rust#156299 When building mismatch suggestions, `can_use_as_ref` may inspect the receiver of a method call that is itself an ill-typed closure expression. In that recovery path, the receiver may not have a recorded type in `TypeckResults`. Use `expr_ty_opt` instead of `expr_ty` so the optional `as_ref()` suggestion is skipped when the receiver type is unavailable.