]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/lifetimes.stderr
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / lifetimes.stderr
index 6d213ad45f243a91d4089253caced6bbcd2dfd6e..abd11907b6d1aece6549157c175b5920717f3990 100644 (file)
-error: explicit lifetimes given in parameter types where they could be elided
- --> $DIR/lifetimes.rs:7:1
-  |
-7 | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) { }
-  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-  |
-note: lint level defined here
- --> $DIR/lifetimes.rs:4:9
-  |
-4 | #![deny(needless_lifetimes, unused_lifetimes)]
-  |         ^^^^^^^^^^^^^^^^^^
-
-error: explicit lifetimes given in parameter types where they could be elided
-  --> $DIR/lifetimes.rs:10:1
-   |
-10 | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) { }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: explicit lifetimes given in parameter types where they could be elided
-  --> $DIR/lifetimes.rs:19:1
-   |
-19 | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 { x }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: explicit lifetimes given in parameter types where they could be elided
-  --> $DIR/lifetimes.rs:32:1
-   |
-32 | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> { Ok(x) }
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:13:1
+   |
+LL | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `-D clippy::needless-lifetimes` implied by `-D warnings`
+
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:15:1
+   |
+LL | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: explicit lifetimes given in parameter types where they could be elided
-  --> $DIR/lifetimes.rs:36:1
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:23:1
+   |
+LL | / fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 {
+LL | |     x
+LL | | }
+   | |_^
+
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:47:1
+   |
+LL | / fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> {
+LL | |     Ok(x)
+LL | | }
+   | |_^
+
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:52:1
    |
-36 | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> where T: Copy { Ok(x) }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()>
+LL | | where
+LL | |     T: Copy,
+LL | | {
+LL | |     Ok(x)
+LL | | }
+   | |_^
 
-error: explicit lifetimes given in parameter types where they could be elided
-  --> $DIR/lifetimes.rs:43:1
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:63:1
    |
-43 | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) { }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: explicit lifetimes given in parameter types where they could be elided
-  --> $DIR/lifetimes.rs:58:1
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:84:1
    |
-58 |   fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
-   |  _^ starting here...
-59 | |     where for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>
-60 | | { unreachable!() }
-   | |__________________^ ...ending here
+LL | / fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
+LL | | where
+LL | |     for<'x> F: Fn(Lt<'x, I>) -> Lt<'x, I>,
+LL | | {
+LL | |     unreachable!()
+LL | | }
+   | |_^
 
-error: explicit lifetimes given in parameter types where they could be elided
-  --> $DIR/lifetimes.rs:67:5
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:117:5
    |
-67 |     fn self_and_out<'s>(&'s self) -> &'s u8 { &self.x }
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | /     fn self_and_out<'s>(&'s self) -> &'s u8 {
+LL | |         &self.x
+LL | |     }
+   | |_____^
 
-error: explicit lifetimes given in parameter types where they could be elided
-  --> $DIR/lifetimes.rs:72:5
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:125:5
    |
-72 |     fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) { }
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: explicit lifetimes given in parameter types where they could be elided
-  --> $DIR/lifetimes.rs:89:1
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:141:1
    |
-89 | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { unimplemented!() }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | / fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
+LL | |     unimplemented!()
+LL | | }
+   | |_^
 
-error: explicit lifetimes given in parameter types where they could be elided
-   --> $DIR/lifetimes.rs:109:1
-    |
-109 | fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str { unimplemented!() }
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:171:1
+   |
+LL | / fn trait_obj_elided2<'a>(_arg: &'a Drop) -> &'a str {
+LL | |     unimplemented!()
+LL | | }
+   | |_^
 
-error: explicit lifetimes given in parameter types where they could be elided
-   --> $DIR/lifetimes.rs:113:1
-    |
-113 | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { unimplemented!() }
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:177:1
+   |
+LL | / fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
+LL | |     unimplemented!()
+LL | | }
+   | |_^
 
-error: explicit lifetimes given in parameter types where they could be elided
-   --> $DIR/lifetimes.rs:124:1
-    |
-124 | fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() }
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:196:1
+   |
+LL | / fn named_input_elided_output<'a>(_arg: &'a str) -> &str {
+LL | |     unimplemented!()
+LL | | }
+   | |_^
 
-error: explicit lifetimes given in parameter types where they could be elided
-   --> $DIR/lifetimes.rs:128:1
-    |
-128 | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { unimplemented!() }
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:204:1
+   |
+LL | / fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) {
+LL | |     unimplemented!()
+LL | | }
+   | |_^
+
+error: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
+  --> $DIR/lifetimes.rs:241:1
+   |
+LL | / fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
+LL | |     unimplemented!()
+LL | | }
+   | |_^
 
-error: aborting due to 14 previous errors
+error: aborting due to 15 previous errors