Files
rust/compiler
Jonathan Brouwer cb4bb14237 Rollup merge of #155877 - qaijuang:fix-155727-fnmut-diagnostic, r=wesleywiser
Avoid misleading return-type note for foreign `Fn` callees

Fixes rust-lang/rust#155727.

The issue occurred because the code that emitted the `Fn`/`FnMut` suggestion only avoided the return-type fallback when it could point at a local callee argument. The local case from rust-lang/rust#125325 was fixed in rust-lang/rust#126226, but nested cross-crate cases could still suggest changing the enclosing function's return type even though the relevant `Fn` requirement came from the callee argument.

This is also the broader diagnostic shape discussed in rust-lang/rust#119985.

This PR checks the instantiated callee predicates for an exact `Fn` bound
on the closure argument, and extends `wrong-closure-arg-suggestion-125325` with cross-crate function and method cases for that path.
2026-04-29 23:51:40 +02:00
..
2026-04-27 17:23:17 +01:00
2026-04-20 00:18:28 +08:00
2026-04-29 07:41:14 +02:00
2026-04-20 00:18:28 +08:00
2026-04-08 21:09:07 +02:00
2026-04-20 00:18:28 +08:00