fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

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