rust/src/test/ui/underscore-lifetime
Esteban Küber 99d9ccd547 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`
   ```
2020-05-30 10:21:58 -07:00
..
dyn-trait-underscore-in-struct.rs Remove licenses 2018-12-25 21:08:33 -07:00
dyn-trait-underscore-in-struct.stderr add long error explanation for E0228 2020-05-12 17:09:09 -07:00
dyn-trait-underscore.nll.stderr Improve output of argument anonymous borrow missing annotation involving opaque return type 2020-05-30 10:21:58 -07:00
dyn-trait-underscore.rs Improve output of argument anonymous borrow missing annotation involving opaque return type 2020-05-30 10:21:58 -07:00
dyn-trait-underscore.stderr Improve output of argument anonymous borrow missing annotation involving opaque return type 2020-05-30 10:21:58 -07:00
in-binder.rs impl<'_> IceCube<'_> {} is now only one error in both editions 2018-10-19 22:57:41 -07:00
in-binder.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
in-fn-return-illegal.rs Remove licenses 2018-12-25 21:08:33 -07:00
in-fn-return-illegal.stderr Account for fn() types in lifetime suggestions 2020-02-05 10:32:01 -08:00
in-struct.rs Remove licenses 2018-12-25 21:08:33 -07:00
in-struct.stderr review comments 2020-02-05 10:32:01 -08:00
underscore-lifetime-binders.rs Update ui test suite to use dyn 2019-05-29 00:57:31 -04:00
underscore-lifetime-binders.stderr Tweak wording 2020-04-22 12:12:33 -07:00
underscore-lifetime-elison-mismatch.nll.stderr Change compare mode to use -Zborrowck=mir 2019-05-12 18:46:43 +01:00
underscore-lifetime-elison-mismatch.rs Remove licenses 2018-12-25 21:08:33 -07:00
underscore-lifetime-elison-mismatch.stderr Update ui tests 2019-11-07 13:02:34 +01:00
underscore-outlives-bounds.rs Update tests 2018-12-04 10:06:05 +01:00
underscore-outlives-bounds.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
where-clause-inherent-impl-ampersand.rs add more to the ERROR messages 2018-10-19 16:44:01 -04:00
where-clause-inherent-impl-ampersand.rust2015.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
where-clause-inherent-impl-ampersand.rust2018.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
where-clause-inherent-impl-underscore.rs Change some tests to use the shorter comment style 2019-11-21 14:09:18 -08:00
where-clause-inherent-impl-underscore.rust2015.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
where-clause-inherent-impl-underscore.rust2018.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
where-clause-trait-impl-region.rs Change some tests to use the shorter comment style 2019-11-21 14:09:18 -08:00
where-clause-trait-impl-region.rust2015.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
where-clause-trait-impl-region.rust2018.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
where-clause-trait-impl-underscore.rs Change some tests to use the shorter comment style 2019-11-21 14:09:18 -08:00
where-clause-trait-impl-underscore.rust2015.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
where-clause-trait-impl-underscore.rust2018.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00
where-clauses.rs fix error messages 2018-10-19 16:41:29 -04:00
where-clauses.stderr performed --bless of 15 ui tests affected 2020-02-07 12:44:31 -05:00