]> git.lizzy.rs Git - rust.git/blob - src/test/ui/single-use-lifetime/fn-types.stderr
Rollup merge of #102962 - flba-eb:remote_test_server_help, r=pietroalbini
[rust.git] / src / test / ui / single-use-lifetime / fn-types.stderr
1 error: lifetime parameter `'a` only used once
2   --> $DIR/fn-types.rs:9:10
3    |
4 LL |   a: for<'a> fn(&'a u32),
5    |          ^^      -- ...is used only here
6    |          |
7    |          this lifetime...
8    |
9 note: the lint level is defined here
10   --> $DIR/fn-types.rs:1:9
11    |
12 LL | #![deny(single_use_lifetimes)]
13    |         ^^^^^^^^^^^^^^^^^^^^
14 help: elide the single-use lifetime
15    |
16 LL -   a: for<'a> fn(&'a u32),
17 LL +   a: fn(&u32),
18    |
19
20 error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types
21   --> $DIR/fn-types.rs:12:22
22    |
23 LL |   d: for<'a> fn() -> &'a u32, // OK, used only in return type.
24    |                      ^^^^^^^
25
26 error: aborting due to 2 previous errors
27
28 For more information about this error, try `rustc --explain E0581`.