]> git.proxmox.com Git - rustc.git/blob - src/test/ui/single-use-lifetime/one-use-in-fn-argument.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / single-use-lifetime / one-use-in-fn-argument.stderr
1 error: lifetime parameter `'a` only used once
2 --> $DIR/one-use-in-fn-argument.rs:8:6
3 |
4 LL | fn a<'a>(x: &'a u32) {
5 | ^^ -- ...is used only here
6 | |
7 | this lifetime...
8 |
9 note: the lint level is defined here
10 --> $DIR/one-use-in-fn-argument.rs:1:9
11 |
12 LL | #![deny(single_use_lifetimes)]
13 | ^^^^^^^^^^^^^^^^^^^^
14 help: elide the single-use lifetime
15 |
16 LL - fn a<'a>(x: &'a u32) {
17 LL + fn a(x: &u32) {
18 |
19
20 error: lifetime parameter `'m` only used once
21 --> $DIR/one-use-in-fn-argument.rs:15:11
22 |
23 LL | fn center<'m>(_: Single<'m>) {}
24 | ^^ -- ...is used only here
25 | |
26 | this lifetime...
27 |
28 help: elide the single-use lifetime
29 |
30 LL - fn center<'m>(_: Single<'m>) {}
31 LL + fn center(_: Single<'_>) {}
32 |
33
34 error: lifetime parameter `'y` only used once
35 --> $DIR/one-use-in-fn-argument.rs:17:13
36 |
37 LL | fn left<'x, 'y>(foo: Double<'x, 'y>) -> &'x u32 { foo.f }
38 | ^^ this lifetime... -- ...is used only here
39 |
40 help: elide the single-use lifetime
41 |
42 LL - fn left<'x, 'y>(foo: Double<'x, 'y>) -> &'x u32 { foo.f }
43 LL + fn left<'x>(foo: Double<'x, '_>) -> &'x u32 { foo.f }
44 |
45
46 error: lifetime parameter `'x` only used once
47 --> $DIR/one-use-in-fn-argument.rs:19:10
48 |
49 LL | fn right<'x, 'y>(foo: Double<'x, 'y>) -> &'y u32 { foo.f }
50 | ^^ this lifetime... -- ...is used only here
51 |
52 help: elide the single-use lifetime
53 |
54 LL - fn right<'x, 'y>(foo: Double<'x, 'y>) -> &'y u32 { foo.f }
55 LL + fn right<'y>(foo: Double<'_, 'y>) -> &'y u32 { foo.f }
56 |
57
58 error: aborting due to 4 previous errors
59