about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-05-30 16:48:53 +0000
committerbors <bors@rust-lang.org>2018-05-30 16:48:53 +0000
commitfddb46eda35be880945348e1ec40260af9306d74 (patch)
treeee0b22341763cd0cb2585dacd9b65fab7c6d8d47 /src/rustllvm/PassWrapper.cpp
parent74d09399c1289a20b1c258153f005f2604f9ec46 (diff)
parenta19a03a31fc1145f66513de74e9b5f89558719ec (diff)
downloadrust-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