]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #105655 - RedDocMD:bug-105645, r=oli-obk
authorfee1-dead <ent3rm4n@gmail.com>
Mon, 9 Jan 2023 15:35:27 +0000 (23:35 +0800)
committerGitHub <noreply@github.com>
Mon, 9 Jan 2023 15:35:27 +0000 (23:35 +0800)
Remove invalid case for mutable borrow suggestion

If we have a call such as `foo(&mut buf)` and after reference
collapsing the type is inferred as `&T` where-as the required type is
`&mut T`, don't suggest `foo(&mut mut buf)`. This is wrong syntactically
and the issue lies elsewhere, not in the borrow.

Fixes #105645

1  2 
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs