fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.5 KiB55 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(x: &u32) {
17   |    --   --
18
19error: lifetime parameter `'m` only used once
20  --> $DIR/one-use-in-fn-argument.rs:15:11
21   |
22LL | fn center<'m>(_: Single<'m>) {}
23   |           ^^            -- ...is used only here
24   |           |
25   |           this lifetime...
26   |
27help: elide the single-use lifetime
28   |
29LL | fn center(_: Single<'_>) {}
30   |         --          ^^
31
32error: lifetime parameter `'y` only used once
33  --> $DIR/one-use-in-fn-argument.rs:17:13
34   |
35LL | fn left<'x, 'y>(foo: Double<'x, 'y>) -> &'x u32 { foo.f }
36   |             ^^ this lifetime... -- ...is used only here
37   |
38help: elide the single-use lifetime
39   |
40LL | fn left<'x>(foo: Double<'x, '_>) -> &'x u32 { foo.f }
41   |          --                 ^^
42
43error: lifetime parameter `'x` only used once
44  --> $DIR/one-use-in-fn-argument.rs:19:10
45   |
46LL | fn right<'x, 'y>(foo: Double<'x, 'y>) -> &'y u32 { foo.f }
47   |          ^^ this lifetime... -- ...is used only here
48   |
49help: elide the single-use lifetime
50   |
51LL | fn right<'y>(foo: Double<'_, 'y>) -> &'y u32 { foo.f }
52   |         --               ^^
53
54error: aborting due to 4 previous errors
55