]> git.lizzy.rs Git - rust.git/commit
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)
commitc1f8a3ffb2b9b155b400a675727ebd470938805c
treee301a684ac7a910ba6c7dab3cd9a44e3359a93c9
parentb7587f1867c73f3517d7071bb4989dd7e19540f1
parentafefbb66c3abea2e9b3acacddf7516b24c2bbeb8
Rollup merge of #105655 - RedDocMD:bug-105645, r=oli-obk

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
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs