about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-05-26 17:02:56 -0700
committerEsteban Küber <esteban@kuber.com.ar>2018-05-30 09:47:09 -0700
commita19a03a31fc1145f66513de74e9b5f89558719ec (patch)
treeee0b22341763cd0cb2585dacd9b65fab7c6d8d47 /src/rustllvm/PassWrapper.cpp
parent74d09399c1289a20b1c258153f005f2604f9ec46 (diff)
downloadrust-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