diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-05-24 11:52:12 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-05-30 10:21:58 -0700 |
| commit | 99d9ccd5478c1cdfbe96216a59e3ce5b2e936278 (patch) | |
| tree | 7ec466e6308ae9262c1a10747eabad5d444a7393 /src/rustllvm/CoverageMappingWrapper.cpp | |
| parent | f49ebbb891c2b6d3226bf77fd82c9cd22e389f32 (diff) | |
| download | rust-99d9ccd5478c1cdfbe96216a59e3ce5b2e936278.tar.gz rust-99d9ccd5478c1cdfbe96216a59e3ce5b2e936278.zip | |
Improve output of argument anonymous borrow missing annotation involving opaque return type
Go from
```
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> file8.rs:22:5
|
22 | / move || {
23 | | *dest = g.get();
24 | | }
| |_____^
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the function body at 18:1...
--> file8.rs:18:1
|
18 | / fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
19 | | where
20 | | G: Get<T>
21 | | {
... |
24 | | }
25 | | }
| |_^
note: ...so that the types are compatible
--> file8.rs:22:5
|
22 | / move || { //~ ERROR cannot infer an appropriate lifetime
23 | | *dest = g.get();
24 | | }
| |_____^
= note: expected `&mut T`
found `&mut T`
note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 18:8...
--> file8.rs:18:8
|
18 | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ^^
note: ...so that return value is valid for the call
--> file8.rs:18:45
|
18 | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ^^^^^^^^^^^^^^^^^^^^^^^
```
to
```
error[E0621]: explicit lifetime required in the type of `dest`
--> file8.rs:18:45
|
18 | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
| ------ ^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required
| |
| help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
```
Diffstat (limited to 'src/rustllvm/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
