diff options
| author | bors <bors@rust-lang.org> | 2018-05-30 16:48:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-05-30 16:48:53 +0000 |
| commit | fddb46eda35be880945348e1ec40260af9306d74 (patch) | |
| tree | ee0b22341763cd0cb2585dacd9b65fab7c6d8d47 /src/rustllvm/PassWrapper.cpp | |
| parent | 74d09399c1289a20b1c258153f005f2604f9ec46 (diff) | |
| parent | a19a03a31fc1145f66513de74e9b5f89558719ec (diff) | |
| download | rust-fddb46eda35be880945348e1ec40260af9306d74.tar.gz rust-fddb46eda35be880945348e1ec40260af9306d74.zip | |
Auto merge of #51100 - estebank:as-ref, r=oli-obk
Suggest using `as_ref` on some borrow errors [hack]
When encountering the following code:
```rust
struct Foo;
fn takes_ref(_: &Foo) {}
let ref opt = Some(Foo);
opt.map(|arg| takes_ref(arg));
```
Suggest using `opt.as_ref().map(|arg| takes_ref(arg));` instead.
This is a stop gap solution until we expand typeck to deal with these
cases in a more graceful way.
#43861
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
