about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-05-22 16:58:19 +0200
committerGitHub <noreply@github.com>2020-05-22 16:58:19 +0200
commit9c34481c495df19d10a91e7991c254c7b4d1cae3 (patch)
treecd23970e94da59bcaac0e63da404cd9816d01450 /src/test/incremental/thinlto
parenta9ca1ec9280ca1e5020edd699917c3367a30a798 (diff)
parente776121431dc73b6e1782d5ddcc4e8d6d714f8e4 (diff)
downloadrust-9c34481c495df19d10a91e7991c254c7b4d1cae3.tar.gz
rust-9c34481c495df19d10a91e7991c254c7b4d1cae3.zip
Rollup merge of #71829 - kper:issue71136, r=matthewjasper
Fix suggestion to borrow in struct

The corresponding issue is #71136.
The compiler suggests that borrowing `the_foos` might solve the problem. This is obviously incorrect.
```
struct Foo(u8);

#[derive(Clone)]
struct FooHolster {
    the_foos: Vec<Foo>,
}
```

I propose as fix to check if there is any colon in the span. However, there might a case where `my_method(B { a: 1, b : foo })` would be appropriate to show a suggestion for `&B ...`.  To fix that too, we can simply check if there is a bracket in the span. This is only possible because both spans are different.
Issue's span: `the_foos: Vec<Foo>`
other's span: `B { a : 1, b : foo }`
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions