2018-05-03 22:43:28 +00:00
|
|
|
error: lifetime parameter `'a` only used once
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/one-use-in-fn-argument.rs:8:6
|
2018-05-03 22:43:28 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | fn a<'a>(x: &'a u32) {
|
2018-06-22 01:17:42 +00:00
|
|
|
| ^^ -- ...is used only here
|
|
|
|
| |
|
|
|
|
| this lifetime...
|
2018-05-03 22:43:28 +00:00
|
|
|
|
|
2020-01-22 23:57:38 +00:00
|
|
|
note: the lint level is defined here
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/one-use-in-fn-argument.rs:1:9
|
2018-05-03 22:43:28 +00:00
|
|
|
|
|
2018-05-18 22:13:53 +00:00
|
|
|
LL | #![deny(single_use_lifetimes)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2018-10-28 06:40:56 +00:00
|
|
|
help: elide the single-use lifetime
|
|
|
|
|
|
2021-06-22 02:07:19 +00:00
|
|
|
LL - fn a<'a>(x: &'a u32) {
|
|
|
|
LL + fn a(x: &u32) {
|
2022-06-08 17:34:57 +00:00
|
|
|
|
|
2018-05-03 22:43:28 +00:00
|
|
|
|
2019-07-06 20:20:35 +00:00
|
|
|
error: lifetime parameter `'m` only used once
|
|
|
|
--> $DIR/one-use-in-fn-argument.rs:15:11
|
|
|
|
|
|
|
|
|
LL | fn center<'m>(_: Single<'m>) {}
|
|
|
|
| ^^ -- ...is used only here
|
|
|
|
| |
|
|
|
|
| this lifetime...
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2019-07-06 22:02:27 +00:00
|
|
|
help: elide the single-use lifetime
|
|
|
|
|
|
2021-06-22 02:07:19 +00:00
|
|
|
LL - fn center<'m>(_: Single<'m>) {}
|
|
|
|
LL + fn center(_: Single<'_>) {}
|
2022-06-08 17:34:57 +00:00
|
|
|
|
|
2019-07-06 20:20:35 +00:00
|
|
|
|
|
|
|
error: lifetime parameter `'y` only used once
|
2019-07-06 22:02:27 +00:00
|
|
|
--> $DIR/one-use-in-fn-argument.rs:17:13
|
2019-07-06 20:20:35 +00:00
|
|
|
|
|
|
|
|
LL | fn left<'x, 'y>(foo: Double<'x, 'y>) -> &'x u32 { foo.f }
|
|
|
|
| ^^ this lifetime... -- ...is used only here
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2019-07-06 22:02:27 +00:00
|
|
|
help: elide the single-use lifetime
|
|
|
|
|
|
2021-06-22 02:07:19 +00:00
|
|
|
LL - fn left<'x, 'y>(foo: Double<'x, 'y>) -> &'x u32 { foo.f }
|
|
|
|
LL + fn left<'x>(foo: Double<'x, '_>) -> &'x u32 { foo.f }
|
2022-06-08 17:34:57 +00:00
|
|
|
|
|
2019-07-06 20:20:35 +00:00
|
|
|
|
|
|
|
error: lifetime parameter `'x` only used once
|
2019-07-06 22:02:27 +00:00
|
|
|
--> $DIR/one-use-in-fn-argument.rs:19:10
|
2019-07-06 20:20:35 +00:00
|
|
|
|
|
|
|
|
LL | fn right<'x, 'y>(foo: Double<'x, 'y>) -> &'y u32 { foo.f }
|
|
|
|
| ^^ this lifetime... -- ...is used only here
|
2019-10-24 05:20:58 +00:00
|
|
|
|
|
2019-07-06 22:02:27 +00:00
|
|
|
help: elide the single-use lifetime
|
|
|
|
|
|
2021-06-22 02:07:19 +00:00
|
|
|
LL - fn right<'x, 'y>(foo: Double<'x, 'y>) -> &'y u32 { foo.f }
|
|
|
|
LL + fn right<'y>(foo: Double<'_, 'y>) -> &'y u32 { foo.f }
|
2022-06-08 17:34:57 +00:00
|
|
|
|
|
2019-07-06 20:20:35 +00:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
2018-05-03 22:43:28 +00:00
|
|
|
|