fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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