diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2018-05-26 17:02:56 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2018-05-30 09:47:09 -0700 |
| commit | a19a03a31fc1145f66513de74e9b5f89558719ec (patch) | |
| tree | ee0b22341763cd0cb2585dacd9b65fab7c6d8d47 /src/rustllvm/PassWrapper.cpp | |
| parent | 74d09399c1289a20b1c258153f005f2604f9ec46 (diff) | |
| download | rust-a19a03a31fc1145f66513de74e9b5f89558719ec.tar.gz rust-a19a03a31fc1145f66513de74e9b5f89558719ec.zip | |
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.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
