mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
a51a163574
Do not suggest borrowing enclosing calls for nested where-clause obligations In rust-lang/rust#155088, the compiler was blaming the whole call expr instead of the value that actually failed the trait bound, so for foo(&[String::from("a")]) it was suggesting stuff like &foo(...). I changed the suggestion logic so it only emits borrow help if the expr it found actually matches the failed self type, and used the same check for the “similar impl exists” help too. So now the compiler should give the normal error + required bound note. Fix rust-lang/rust#155088