Fix non-lifetime tests

This commit is contained in:
Samuel Moelius 2024-08-18 07:31:47 -04:00
parent f2495a1777
commit 877585089e
46 changed files with 354 additions and 329 deletions

View File

@ -7,7 +7,8 @@
clippy::no_effect,
clippy::unnecessary_operation,
clippy::useless_vec,
clippy::out_of_bounds_indexing
clippy::out_of_bounds_indexing,
clippy::needless_lifetimes
)]
const ARR: [i32; 2] = [1, 2];

View File

@ -1,5 +1,5 @@
error: indexing may panic
--> tests/ui-toml/suppress_lint_in_const/test.rs:26:5
--> tests/ui-toml/suppress_lint_in_const/test.rs:27:5
|
LL | x[index];
| ^^^^^^^^
@ -9,7 +9,7 @@ LL | x[index];
= help: to override `-D warnings` add `#[allow(clippy::indexing_slicing)]`
error: indexing may panic
--> tests/ui-toml/suppress_lint_in_const/test.rs:41:5
--> tests/ui-toml/suppress_lint_in_const/test.rs:42:5
|
LL | v[0];
| ^^^^
@ -17,7 +17,7 @@ LL | v[0];
= help: consider using `.get(n)` or `.get_mut(n)` instead
error: indexing may panic
--> tests/ui-toml/suppress_lint_in_const/test.rs:42:5
--> tests/ui-toml/suppress_lint_in_const/test.rs:43:5
|
LL | v[10];
| ^^^^^
@ -25,7 +25,7 @@ LL | v[10];
= help: consider using `.get(n)` or `.get_mut(n)` instead
error: indexing may panic
--> tests/ui-toml/suppress_lint_in_const/test.rs:43:5
--> tests/ui-toml/suppress_lint_in_const/test.rs:44:5
|
LL | v[1 << 3];
| ^^^^^^^^^
@ -33,7 +33,7 @@ LL | v[1 << 3];
= help: consider using `.get(n)` or `.get_mut(n)` instead
error: indexing may panic
--> tests/ui-toml/suppress_lint_in_const/test.rs:49:5
--> tests/ui-toml/suppress_lint_in_const/test.rs:50:5
|
LL | v[N];
| ^^^^
@ -41,7 +41,7 @@ LL | v[N];
= help: consider using `.get(n)` or `.get_mut(n)` instead
error: indexing may panic
--> tests/ui-toml/suppress_lint_in_const/test.rs:50:5
--> tests/ui-toml/suppress_lint_in_const/test.rs:51:5
|
LL | v[M];
| ^^^^

View File

@ -3,7 +3,8 @@
#![allow(
clippy::uninlined_format_args,
clippy::disallowed_names,
clippy::needless_pass_by_ref_mut
clippy::needless_pass_by_ref_mut,
clippy::needless_lifetimes
)]
use std::fmt::Display;

View File

@ -3,7 +3,8 @@
#![allow(
clippy::uninlined_format_args,
clippy::disallowed_names,
clippy::needless_pass_by_ref_mut
clippy::needless_pass_by_ref_mut,
clippy::needless_lifetimes
)]
use std::fmt::Display;

View File

@ -1,5 +1,5 @@
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> tests/ui/borrow_box.rs:24:14
--> tests/ui/borrow_box.rs:25:14
|
LL | let foo: &Box<bool>;
| ^^^^^^^^^^ help: try: `&bool`
@ -11,55 +11,55 @@ LL | #![deny(clippy::borrowed_box)]
| ^^^^^^^^^^^^^^^^^^^^
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> tests/ui/borrow_box.rs:29:10
--> tests/ui/borrow_box.rs:30:10
|
LL | foo: &'a Box<bool>,
| ^^^^^^^^^^^^^ help: try: `&'a bool`
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> tests/ui/borrow_box.rs:34:17
--> tests/ui/borrow_box.rs:35:17
|
LL | fn test4(a: &Box<bool>);
| ^^^^^^^^^^ help: try: `&bool`
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> tests/ui/borrow_box.rs:95:25
--> tests/ui/borrow_box.rs:96:25
|
LL | pub fn test14(_display: &Box<dyn Display>) {}
| ^^^^^^^^^^^^^^^^^ help: try: `&dyn Display`
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> tests/ui/borrow_box.rs:97:25
--> tests/ui/borrow_box.rs:98:25
|
LL | pub fn test15(_display: &Box<dyn Display + Send>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn Display + Send)`
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> tests/ui/borrow_box.rs:99:29
--> tests/ui/borrow_box.rs:100:29
|
LL | pub fn test16<'a>(_display: &'a Box<dyn Display + 'a>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a (dyn Display + 'a)`
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> tests/ui/borrow_box.rs:102:25
--> tests/ui/borrow_box.rs:103:25
|
LL | pub fn test17(_display: &Box<impl Display>) {}
| ^^^^^^^^^^^^^^^^^^ help: try: `&impl Display`
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> tests/ui/borrow_box.rs:104:25
--> tests/ui/borrow_box.rs:105:25
|
LL | pub fn test18(_display: &Box<impl Display + Send>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(impl Display + Send)`
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> tests/ui/borrow_box.rs:106:29
--> tests/ui/borrow_box.rs:107:29
|
LL | pub fn test19<'a>(_display: &'a Box<impl Display + 'a>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a (impl Display + 'a)`
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> tests/ui/borrow_box.rs:112:25
--> tests/ui/borrow_box.rs:113:25
|
LL | pub fn test20(_display: &Box<(dyn Display + Send)>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn Display + Send)`

View File

@ -3,7 +3,8 @@
clippy::needless_pass_by_value,
clippy::unused_unit,
clippy::redundant_clone,
clippy::match_single_binding
clippy::match_single_binding,
clippy::needless_lifetimes
)]
#![warn(clippy::boxed_local)]

View File

@ -1,5 +1,5 @@
error: local variable doesn't need to be boxed here
--> tests/ui/boxed_local.rs:39:13
--> tests/ui/boxed_local.rs:40:13
|
LL | fn warn_arg(x: Box<A>) {
| ^
@ -8,19 +8,19 @@ LL | fn warn_arg(x: Box<A>) {
= help: to override `-D warnings` add `#[allow(clippy::boxed_local)]`
error: local variable doesn't need to be boxed here
--> tests/ui/boxed_local.rs:122:12
--> tests/ui/boxed_local.rs:123:12
|
LL | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {}
| ^^^^^^^^^^^
error: local variable doesn't need to be boxed here
--> tests/ui/boxed_local.rs:187:44
--> tests/ui/boxed_local.rs:188:44
|
LL | fn default_impl_x(self: Box<Self>, x: Box<u32>) -> u32 {
| ^
error: local variable doesn't need to be boxed here
--> tests/ui/boxed_local.rs:195:16
--> tests/ui/boxed_local.rs:196:16
|
LL | fn foo(x: Box<u32>) {}
| ^

View File

@ -1,4 +1,9 @@
#![allow(clippy::non_canonical_clone_impl, clippy::non_canonical_partial_ord_impl, dead_code)]
#![allow(
clippy::non_canonical_clone_impl,
clippy::non_canonical_partial_ord_impl,
clippy::needless_lifetimes,
dead_code
)]
#![warn(clippy::expl_impl_clone_on_copy)]
#[derive(Copy)]

View File

@ -1,5 +1,5 @@
error: you are implementing `Clone` explicitly on a `Copy` type
--> tests/ui/derive.rs:7:1
--> tests/ui/derive.rs:12:1
|
LL | / impl Clone for Qux {
LL | |
@ -10,7 +10,7 @@ LL | | }
| |_^
|
note: consider deriving `Clone` or removing `Copy`
--> tests/ui/derive.rs:7:1
--> tests/ui/derive.rs:12:1
|
LL | / impl Clone for Qux {
LL | |
@ -23,7 +23,7 @@ LL | | }
= help: to override `-D warnings` add `#[allow(clippy::expl_impl_clone_on_copy)]`
error: you are implementing `Clone` explicitly on a `Copy` type
--> tests/ui/derive.rs:32:1
--> tests/ui/derive.rs:37:1
|
LL | / impl<'a> Clone for Lt<'a> {
LL | |
@ -34,7 +34,7 @@ LL | | }
| |_^
|
note: consider deriving `Clone` or removing `Copy`
--> tests/ui/derive.rs:32:1
--> tests/ui/derive.rs:37:1
|
LL | / impl<'a> Clone for Lt<'a> {
LL | |
@ -45,7 +45,7 @@ LL | | }
| |_^
error: you are implementing `Clone` explicitly on a `Copy` type
--> tests/ui/derive.rs:44:1
--> tests/ui/derive.rs:49:1
|
LL | / impl Clone for BigArray {
LL | |
@ -56,7 +56,7 @@ LL | | }
| |_^
|
note: consider deriving `Clone` or removing `Copy`
--> tests/ui/derive.rs:44:1
--> tests/ui/derive.rs:49:1
|
LL | / impl Clone for BigArray {
LL | |
@ -67,7 +67,7 @@ LL | | }
| |_^
error: you are implementing `Clone` explicitly on a `Copy` type
--> tests/ui/derive.rs:56:1
--> tests/ui/derive.rs:61:1
|
LL | / impl Clone for FnPtr {
LL | |
@ -78,7 +78,7 @@ LL | | }
| |_^
|
note: consider deriving `Clone` or removing `Copy`
--> tests/ui/derive.rs:56:1
--> tests/ui/derive.rs:61:1
|
LL | / impl Clone for FnPtr {
LL | |
@ -89,7 +89,7 @@ LL | | }
| |_^
error: you are implementing `Clone` explicitly on a `Copy` type
--> tests/ui/derive.rs:77:1
--> tests/ui/derive.rs:82:1
|
LL | / impl<T: Clone> Clone for Generic2<T> {
LL | |
@ -100,7 +100,7 @@ LL | | }
| |_^
|
note: consider deriving `Clone` or removing `Copy`
--> tests/ui/derive.rs:77:1
--> tests/ui/derive.rs:82:1
|
LL | / impl<T: Clone> Clone for Generic2<T> {
LL | |

View File

@ -9,7 +9,8 @@
clippy::redundant_closure_call,
clippy::uninlined_format_args,
clippy::useless_vec,
clippy::unnecessary_map_on_constructor
clippy::unnecessary_map_on_constructor,
clippy::needless_lifetimes
)]
use std::path::{Path, PathBuf};

View File

@ -9,7 +9,8 @@
clippy::redundant_closure_call,
clippy::uninlined_format_args,
clippy::useless_vec,
clippy::unnecessary_map_on_constructor
clippy::unnecessary_map_on_constructor,
clippy::needless_lifetimes
)]
use std::path::{Path, PathBuf};

View File

@ -1,5 +1,5 @@
error: redundant closure
--> tests/ui/eta.rs:30:27
--> tests/ui/eta.rs:31:27
|
LL | let a = Some(1u8).map(|a| foo(a));
| ^^^^^^^^^^ help: replace the closure with the function itself: `foo`
@ -8,31 +8,31 @@ LL | let a = Some(1u8).map(|a| foo(a));
= help: to override `-D warnings` add `#[allow(clippy::redundant_closure)]`
error: redundant closure
--> tests/ui/eta.rs:34:40
--> tests/ui/eta.rs:35:40
|
LL | let _: Option<Vec<u8>> = true.then(|| vec![]); // special case vec!
| ^^^^^^^^^ help: replace the closure with `Vec::new`: `std::vec::Vec::new`
error: redundant closure
--> tests/ui/eta.rs:35:35
--> tests/ui/eta.rs:36:35
|
LL | let d = Some(1u8).map(|a| foo((|b| foo2(b))(a))); //is adjusted?
| ^^^^^^^^^^^^^ help: replace the closure with the function itself: `foo2`
error: redundant closure
--> tests/ui/eta.rs:36:26
--> tests/ui/eta.rs:37:26
|
LL | all(&[1, 2, 3], &&2, |x, y| below(x, y)); //is adjusted
| ^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `below`
error: redundant closure
--> tests/ui/eta.rs:43:27
--> tests/ui/eta.rs:44:27
|
LL | let e = Some(1u8).map(|a| generic(a));
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `generic`
error: redundant closure
--> tests/ui/eta.rs:95:51
--> tests/ui/eta.rs:96:51
|
LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.foo());
| ^^^^^^^^^^^ help: replace the closure with the method itself: `TestStruct::foo`
@ -41,169 +41,169 @@ LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.foo());
= help: to override `-D warnings` add `#[allow(clippy::redundant_closure_for_method_calls)]`
error: redundant closure
--> tests/ui/eta.rs:96:51
--> tests/ui/eta.rs:97:51
|
LL | let e = Some(TestStruct { some_ref: &i }).map(|a| a.trait_foo());
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `TestTrait::trait_foo`
error: redundant closure
--> tests/ui/eta.rs:98:42
--> tests/ui/eta.rs:99:42
|
LL | let e = Some(&mut vec![1, 2, 3]).map(|v| v.clear());
| ^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::vec::Vec::clear`
error: redundant closure
--> tests/ui/eta.rs:102:29
--> tests/ui/eta.rs:103:29
|
LL | let e = Some("str").map(|s| s.to_string());
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::string::ToString::to_string`
error: redundant closure
--> tests/ui/eta.rs:103:27
--> tests/ui/eta.rs:104:27
|
LL | let e = Some('a').map(|s| s.to_uppercase());
| ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::to_uppercase`
error: redundant closure
--> tests/ui/eta.rs:105:65
--> tests/ui/eta.rs:106:65
|
LL | let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::to_ascii_uppercase`
error: redundant closure
--> tests/ui/eta.rs:168:22
--> tests/ui/eta.rs:169:22
|
LL | requires_fn_once(|| x());
| ^^^^^^ help: replace the closure with the function itself: `x`
error: redundant closure
--> tests/ui/eta.rs:175:27
--> tests/ui/eta.rs:176:27
|
LL | let a = Some(1u8).map(|a| foo_ptr(a));
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `foo_ptr`
error: redundant closure
--> tests/ui/eta.rs:180:27
--> tests/ui/eta.rs:181:27
|
LL | let a = Some(1u8).map(|a| closure(a));
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `closure`
error: redundant closure
--> tests/ui/eta.rs:212:28
--> tests/ui/eta.rs:213:28
|
LL | x.into_iter().for_each(|x| add_to_res(x));
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
error: redundant closure
--> tests/ui/eta.rs:213:28
--> tests/ui/eta.rs:214:28
|
LL | y.into_iter().for_each(|x| add_to_res(x));
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
error: redundant closure
--> tests/ui/eta.rs:214:28
--> tests/ui/eta.rs:215:28
|
LL | z.into_iter().for_each(|x| add_to_res(x));
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `add_to_res`
error: redundant closure
--> tests/ui/eta.rs:221:21
--> tests/ui/eta.rs:222:21
|
LL | Some(1).map(|n| closure(n));
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut closure`
error: redundant closure
--> tests/ui/eta.rs:225:21
--> tests/ui/eta.rs:226:21
|
LL | Some(1).map(|n| in_loop(n));
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `in_loop`
error: redundant closure
--> tests/ui/eta.rs:318:18
--> tests/ui/eta.rs:319:18
|
LL | takes_fn_mut(|| f());
| ^^^^^^ help: replace the closure with the function itself: `&mut f`
error: redundant closure
--> tests/ui/eta.rs:321:19
--> tests/ui/eta.rs:322:19
|
LL | takes_fn_once(|| f());
| ^^^^^^ help: replace the closure with the function itself: `&mut f`
error: redundant closure
--> tests/ui/eta.rs:325:26
--> tests/ui/eta.rs:326:26
|
LL | move || takes_fn_mut(|| f_used_once())
| ^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut f_used_once`
error: redundant closure
--> tests/ui/eta.rs:337:19
--> tests/ui/eta.rs:338:19
|
LL | array_opt.map(|a| a.as_slice());
| ^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<[u8; 3]>::as_slice`
error: redundant closure
--> tests/ui/eta.rs:340:19
--> tests/ui/eta.rs:341:19
|
LL | slice_opt.map(|s| s.len());
| ^^^^^^^^^^^ help: replace the closure with the method itself: `<[u8]>::len`
error: redundant closure
--> tests/ui/eta.rs:343:17
--> tests/ui/eta.rs:344:17
|
LL | ptr_opt.map(|p| p.is_null());
| ^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<*const usize>::is_null`
error: redundant closure
--> tests/ui/eta.rs:347:17
--> tests/ui/eta.rs:348:17
|
LL | dyn_opt.map(|d| d.method_on_dyn());
| ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<dyn TestTrait>::method_on_dyn`
error: redundant closure
--> tests/ui/eta.rs:407:19
--> tests/ui/eta.rs:408:19
|
LL | let _ = f(&0, |x, y| f2(x, y));
| ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `f2`
error: redundant closure
--> tests/ui/eta.rs:435:22
--> tests/ui/eta.rs:436:22
|
LL | test.map(|t| t.method())
| ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `Test::method`
error: redundant closure
--> tests/ui/eta.rs:439:22
--> tests/ui/eta.rs:440:22
|
LL | test.map(|t| t.method())
| ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `super::Outer::method`
error: redundant closure
--> tests/ui/eta.rs:452:18
--> tests/ui/eta.rs:453:18
|
LL | test.map(|t| t.method())
| ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `test_mod::Test::method`
error: redundant closure
--> tests/ui/eta.rs:459:30
--> tests/ui/eta.rs:460:30
|
LL | test.map(|t| t.method())
| ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `crate::issue_10854::d::Test::method`
error: redundant closure
--> tests/ui/eta.rs:478:38
--> tests/ui/eta.rs:479:38
|
LL | let x = Box::new(|| None.map(|x| f(x)));
| ^^^^^^^^ help: replace the closure with the function itself: `&f`
error: redundant closure
--> tests/ui/eta.rs:482:38
--> tests/ui/eta.rs:483:38
|
LL | let x = Box::new(|| None.map(|x| f(x)));
| ^^^^^^^^ help: replace the closure with the function itself: `f`
error: redundant closure
--> tests/ui/eta.rs:499:35
--> tests/ui/eta.rs:500:35
|
LL | let _field = bind.or_else(|| get_default()).unwrap();
| ^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_default`

View File

@ -10,7 +10,8 @@
clippy::redundant_field_names,
clippy::too_many_arguments,
clippy::borrow_deref_ref,
clippy::let_unit_value
clippy::let_unit_value,
clippy::needless_lifetimes
)]
trait CallableStr {

View File

@ -10,7 +10,8 @@
clippy::redundant_field_names,
clippy::too_many_arguments,
clippy::borrow_deref_ref,
clippy::let_unit_value
clippy::let_unit_value,
clippy::needless_lifetimes
)]
trait CallableStr {

View File

@ -1,5 +1,5 @@
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:68:19
--> tests/ui/explicit_auto_deref.rs:69:19
|
LL | let _: &str = &*s;
| ^^^ help: try: `&s`
@ -8,271 +8,271 @@ LL | let _: &str = &*s;
= help: to override `-D warnings` add `#[allow(clippy::explicit_auto_deref)]`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:69:19
--> tests/ui/explicit_auto_deref.rs:70:19
|
LL | let _: &str = &*{ String::new() };
| ^^^^^^^^^^^^^^^^^^^ help: try: `&{ String::new() }`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:70:19
--> tests/ui/explicit_auto_deref.rs:71:19
|
LL | let _: &str = &mut *{ String::new() };
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut { String::new() }`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:74:11
--> tests/ui/explicit_auto_deref.rs:75:11
|
LL | f_str(&*s);
| ^^^ help: try: `&s`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:78:13
--> tests/ui/explicit_auto_deref.rs:79:13
|
LL | f_str_t(&*s, &*s); // Don't lint second param.
| ^^^ help: try: `&s`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:81:24
--> tests/ui/explicit_auto_deref.rs:82:24
|
LL | let _: &Box<i32> = &**b;
| ^^^^ help: try: `&b`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:87:7
--> tests/ui/explicit_auto_deref.rs:88:7
|
LL | c(&*s);
| ^^^ help: try: `&s`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:93:9
--> tests/ui/explicit_auto_deref.rs:94:9
|
LL | &**x
| ^^^^ help: try: `x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:97:11
--> tests/ui/explicit_auto_deref.rs:98:11
|
LL | { &**x }
| ^^^^ help: try: `x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:101:9
--> tests/ui/explicit_auto_deref.rs:102:9
|
LL | &**{ x }
| ^^^^^^^^ help: try: `{ x }`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:105:9
--> tests/ui/explicit_auto_deref.rs:106:9
|
LL | &***x
| ^^^^^ help: try: `x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:122:12
--> tests/ui/explicit_auto_deref.rs:123:12
|
LL | f1(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:123:12
--> tests/ui/explicit_auto_deref.rs:124:12
|
LL | f2(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:124:12
--> tests/ui/explicit_auto_deref.rs:125:12
|
LL | f3(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:125:27
--> tests/ui/explicit_auto_deref.rs:126:27
|
LL | f4.callable_str()(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:126:12
--> tests/ui/explicit_auto_deref.rs:127:12
|
LL | f5(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:127:12
--> tests/ui/explicit_auto_deref.rs:128:12
|
LL | f6(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:128:27
--> tests/ui/explicit_auto_deref.rs:129:27
|
LL | f7.callable_str()(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:129:25
--> tests/ui/explicit_auto_deref.rs:130:25
|
LL | f8.callable_t()(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:130:12
--> tests/ui/explicit_auto_deref.rs:131:12
|
LL | f9(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:131:13
--> tests/ui/explicit_auto_deref.rs:132:13
|
LL | f10(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:132:26
--> tests/ui/explicit_auto_deref.rs:133:26
|
LL | f11.callable_t()(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:136:16
--> tests/ui/explicit_auto_deref.rs:137:16
|
LL | let _ = S1(&*s);
| ^^^ help: try: `&s`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:141:21
--> tests/ui/explicit_auto_deref.rs:142:21
|
LL | let _ = S2 { s: &*s };
| ^^^ help: try: `&s`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:157:30
--> tests/ui/explicit_auto_deref.rs:158:30
|
LL | let _ = Self::S1(&**s);
| ^^^^ help: try: `s`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:158:35
--> tests/ui/explicit_auto_deref.rs:159:35
|
LL | let _ = Self::S2 { s: &**s };
| ^^^^ help: try: `s`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:161:20
--> tests/ui/explicit_auto_deref.rs:162:20
|
LL | let _ = E1::S1(&*s);
| ^^^ help: try: `&s`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:162:25
--> tests/ui/explicit_auto_deref.rs:163:25
|
LL | let _ = E1::S2 { s: &*s };
| ^^^ help: try: `&s`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:180:13
--> tests/ui/explicit_auto_deref.rs:181:13
|
LL | let _ = (*b).foo;
| ^^^^ help: try: `b`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:181:13
--> tests/ui/explicit_auto_deref.rs:182:13
|
LL | let _ = (**b).foo;
| ^^^^^ help: try: `b`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:196:19
--> tests/ui/explicit_auto_deref.rs:197:19
|
LL | let _ = f_str(*ref_str);
| ^^^^^^^^ help: try: `ref_str`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:198:19
--> tests/ui/explicit_auto_deref.rs:199:19
|
LL | let _ = f_str(**ref_ref_str);
| ^^^^^^^^^^^^^ help: try: `ref_ref_str`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:208:12
--> tests/ui/explicit_auto_deref.rs:209:12
|
LL | f_str(&&*ref_str); // `needless_borrow` will suggest removing both references
| ^^^^^^^^^ help: try: `ref_str`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:209:12
--> tests/ui/explicit_auto_deref.rs:210:12
|
LL | f_str(&&**ref_str); // `needless_borrow` will suggest removing only one reference
| ^^^^^^^^^^ help: try: `ref_str`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:218:41
--> tests/ui/explicit_auto_deref.rs:219:41
|
LL | let _ = || -> &'static str { return *s };
| ^^ help: try: `s`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:237:9
--> tests/ui/explicit_auto_deref.rs:238:9
|
LL | &**x
| ^^^^ help: try: `x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:260:8
--> tests/ui/explicit_auto_deref.rs:261:8
|
LL | c1(*x);
| ^^ help: try: `x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:263:20
--> tests/ui/explicit_auto_deref.rs:264:20
|
LL | return *x;
| ^^ help: try: `x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:265:9
--> tests/ui/explicit_auto_deref.rs:266:9
|
LL | *x
| ^^ help: try: `x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:299:20
--> tests/ui/explicit_auto_deref.rs:300:20
|
LL | Some(x) => &mut *x,
| ^^^^^^^ help: try: `x`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:332:22
--> tests/ui/explicit_auto_deref.rs:333:22
|
LL | let _ = &mut (*{ x.u }).x;
| ^^^^^^^^^^ help: try: `{ x.u }`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:338:22
--> tests/ui/explicit_auto_deref.rs:339:22
|
LL | let _ = &mut (**x.u).x;
| ^^^^^^^ help: try: `(*x.u)`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:339:22
--> tests/ui/explicit_auto_deref.rs:340:22
|
LL | let _ = &mut (**{ x.u }).x;
| ^^^^^^^^^^^ help: try: `{ x.u }`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:343:22
--> tests/ui/explicit_auto_deref.rs:344:22
|
LL | let _ = &mut (*x.u).x;
| ^^^^^^ help: try: `x.u`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:344:22
--> tests/ui/explicit_auto_deref.rs:345:22
|
LL | let _ = &mut (*{ x.u }).x;
| ^^^^^^^^^^ help: try: `{ x.u }`
error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:367:13
--> tests/ui/explicit_auto_deref.rs:368:13
|
LL | foo(&*wrapped_bar);
| ^^^^^^^^^^^^^ help: try: `&wrapped_bar`

View File

@ -1,5 +1,5 @@
#![deny(clippy::index_refutable_slice)]
#![allow(clippy::uninlined_format_args)]
#![allow(clippy::uninlined_format_args, clippy::needless_lifetimes)]
//@no-rustfix: need to change the suggestion to a multipart suggestion

View File

@ -1,6 +1,7 @@
//@no-rustfix
//@aux-build:proc_macros.rs
#![warn(clippy::iter_without_into_iter)]
#![allow(clippy::needless_lifetimes)]
extern crate proc_macros;
pub struct S1;

View File

@ -1,5 +1,5 @@
error: `iter` method without an `IntoIterator` impl for `&S1`
--> tests/ui/iter_without_into_iter.rs:8:5
--> tests/ui/iter_without_into_iter.rs:9:5
|
LL | / pub fn iter(&self) -> std::slice::Iter<'_, u8> {
LL | |
@ -22,7 +22,7 @@ LL + }
|
error: `iter_mut` method without an `IntoIterator` impl for `&mut S1`
--> tests/ui/iter_without_into_iter.rs:12:5
--> tests/ui/iter_without_into_iter.rs:13:5
|
LL | / pub fn iter_mut(&mut self) -> std::slice::IterMut<'_, u8> {
LL | |
@ -43,7 +43,7 @@ LL + }
|
error: `iter` method without an `IntoIterator` impl for `&S3<'a>`
--> tests/ui/iter_without_into_iter.rs:28:5
--> tests/ui/iter_without_into_iter.rs:29:5
|
LL | / pub fn iter(&self) -> std::slice::Iter<'_, u8> {
LL | |
@ -64,7 +64,7 @@ LL + }
|
error: `iter_mut` method without an `IntoIterator` impl for `&mut S3<'a>`
--> tests/ui/iter_without_into_iter.rs:32:5
--> tests/ui/iter_without_into_iter.rs:33:5
|
LL | / pub fn iter_mut(&mut self) -> std::slice::IterMut<'_, u8> {
LL | |
@ -85,7 +85,7 @@ LL + }
|
error: `iter` method without an `IntoIterator` impl for `&S8<T>`
--> tests/ui/iter_without_into_iter.rs:69:5
--> tests/ui/iter_without_into_iter.rs:70:5
|
LL | / pub fn iter(&self) -> std::slice::Iter<'static, T> {
LL | | todo!()
@ -105,7 +105,7 @@ LL + }
|
error: `iter` method without an `IntoIterator` impl for `&S9<T>`
--> tests/ui/iter_without_into_iter.rs:77:5
--> tests/ui/iter_without_into_iter.rs:78:5
|
LL | / pub fn iter(&self) -> std::slice::Iter<'_, T> {
LL | |
@ -126,7 +126,7 @@ LL + }
|
error: `iter_mut` method without an `IntoIterator` impl for `&mut S9<T>`
--> tests/ui/iter_without_into_iter.rs:81:5
--> tests/ui/iter_without_into_iter.rs:82:5
|
LL | / pub fn iter_mut(&mut self) -> std::slice::IterMut<'_, T> {
LL | |
@ -147,7 +147,7 @@ LL + }
|
error: `iter` method without an `IntoIterator` impl for `&Issue12037`
--> tests/ui/iter_without_into_iter.rs:130:13
--> tests/ui/iter_without_into_iter.rs:131:13
|
LL | / fn iter(&self) -> std::slice::Iter<'_, u8> {
LL | | todo!()

View File

@ -1,6 +1,5 @@
#![allow(unused)]
#![allow(unused, clippy::needless_lifetimes)]
#![warn(
clippy::all,
clippy::style,
clippy::mem_replace_option_with_none,
clippy::mem_replace_with_default

View File

@ -1,6 +1,5 @@
#![allow(unused)]
#![allow(unused, clippy::needless_lifetimes)]
#![warn(
clippy::all,
clippy::style,
clippy::mem_replace_option_with_none,
clippy::mem_replace_with_default

View File

@ -1,5 +1,5 @@
error: replacing an `Option` with `None`
--> tests/ui/mem_replace.rs:14:13
--> tests/ui/mem_replace.rs:13:13
|
LL | let _ = mem::replace(&mut an_option, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
@ -8,13 +8,13 @@ LL | let _ = mem::replace(&mut an_option, None);
= help: to override `-D warnings` add `#[allow(clippy::mem_replace_option_with_none)]`
error: replacing an `Option` with `None`
--> tests/ui/mem_replace.rs:16:13
--> tests/ui/mem_replace.rs:15:13
|
LL | let _ = mem::replace(an_option, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:21:13
--> tests/ui/mem_replace.rs:20:13
|
LL | let _ = std::mem::replace(&mut s, String::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut s)`
@ -23,127 +23,127 @@ LL | let _ = std::mem::replace(&mut s, String::default());
= help: to override `-D warnings` add `#[allow(clippy::mem_replace_with_default)]`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:24:13
--> tests/ui/mem_replace.rs:23:13
|
LL | let _ = std::mem::replace(s, String::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(s)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:25:13
--> tests/ui/mem_replace.rs:24:13
|
LL | let _ = std::mem::replace(s, Default::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(s)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:28:13
--> tests/ui/mem_replace.rs:27:13
|
LL | let _ = std::mem::replace(&mut v, Vec::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut v)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:29:13
--> tests/ui/mem_replace.rs:28:13
|
LL | let _ = std::mem::replace(&mut v, Default::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut v)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:30:13
--> tests/ui/mem_replace.rs:29:13
|
LL | let _ = std::mem::replace(&mut v, Vec::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut v)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:31:13
--> tests/ui/mem_replace.rs:30:13
|
LL | let _ = std::mem::replace(&mut v, vec![]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut v)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:34:13
--> tests/ui/mem_replace.rs:33:13
|
LL | let _ = std::mem::replace(&mut hash_map, HashMap::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut hash_map)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:37:13
--> tests/ui/mem_replace.rs:36:13
|
LL | let _ = std::mem::replace(&mut btree_map, BTreeMap::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut btree_map)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:40:13
--> tests/ui/mem_replace.rs:39:13
|
LL | let _ = std::mem::replace(&mut vd, VecDeque::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut vd)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:43:13
--> tests/ui/mem_replace.rs:42:13
|
LL | let _ = std::mem::replace(&mut hash_set, HashSet::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut hash_set)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:46:13
--> tests/ui/mem_replace.rs:45:13
|
LL | let _ = std::mem::replace(&mut btree_set, BTreeSet::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut btree_set)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:49:13
--> tests/ui/mem_replace.rs:48:13
|
LL | let _ = std::mem::replace(&mut list, LinkedList::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut list)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:52:13
--> tests/ui/mem_replace.rs:51:13
|
LL | let _ = std::mem::replace(&mut binary_heap, BinaryHeap::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut binary_heap)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:55:13
--> tests/ui/mem_replace.rs:54:13
|
LL | let _ = std::mem::replace(&mut tuple, (vec![], BinaryHeap::new()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut tuple)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:58:13
--> tests/ui/mem_replace.rs:57:13
|
LL | let _ = std::mem::replace(&mut refstr, "");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut refstr)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:61:13
--> tests/ui/mem_replace.rs:60:13
|
LL | let _ = std::mem::replace(&mut slice, &[]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut slice)`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:97:13
--> tests/ui/mem_replace.rs:96:13
|
LL | let _ = std::mem::replace(&mut s, String::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut s)`
error: replacing an `Option` with `None`
--> tests/ui/mem_replace.rs:127:13
--> tests/ui/mem_replace.rs:126:13
|
LL | let _ = std::mem::replace(&mut f.0, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `f.0.take()`
error: replacing an `Option` with `None`
--> tests/ui/mem_replace.rs:128:13
--> tests/ui/mem_replace.rs:127:13
|
LL | let _ = std::mem::replace(&mut *f, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `(*f).take()`
error: replacing an `Option` with `None`
--> tests/ui/mem_replace.rs:129:13
--> tests/ui/mem_replace.rs:128:13
|
LL | let _ = std::mem::replace(&mut b.opt, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `b.opt.take()`
error: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take`
--> tests/ui/mem_replace.rs:131:13
--> tests/ui/mem_replace.rs:130:13
|
LL | let _ = std::mem::replace(&mut b.val, String::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::mem::take(&mut b.val)`

View File

@ -1,6 +1,5 @@
#![allow(unused)]
#![allow(unused, clippy::needless_lifetimes)]
#![warn(
clippy::all,
clippy::style,
clippy::mem_replace_option_with_none,
clippy::mem_replace_with_default

View File

@ -1,6 +1,5 @@
#![allow(unused)]
#![allow(unused, clippy::needless_lifetimes)]
#![warn(
clippy::all,
clippy::style,
clippy::mem_replace_option_with_none,
clippy::mem_replace_with_default

View File

@ -1,5 +1,5 @@
error: replacing an `Option` with `None`
--> tests/ui/mem_replace_no_std.rs:24:13
--> tests/ui/mem_replace_no_std.rs:23:13
|
LL | let _ = mem::replace(&mut an_option, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
@ -8,13 +8,13 @@ LL | let _ = mem::replace(&mut an_option, None);
= help: to override `-D warnings` add `#[allow(clippy::mem_replace_option_with_none)]`
error: replacing an `Option` with `None`
--> tests/ui/mem_replace_no_std.rs:26:13
--> tests/ui/mem_replace_no_std.rs:25:13
|
LL | let _ = mem::replace(an_option, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `an_option.take()`
error: replacing a value of type `T` with `T::default()` is better expressed using `core::mem::take`
--> tests/ui/mem_replace_no_std.rs:31:13
--> tests/ui/mem_replace_no_std.rs:30:13
|
LL | let _ = mem::replace(&mut refstr, "");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `core::mem::take(&mut refstr)`
@ -23,25 +23,25 @@ LL | let _ = mem::replace(&mut refstr, "");
= help: to override `-D warnings` add `#[allow(clippy::mem_replace_with_default)]`
error: replacing a value of type `T` with `T::default()` is better expressed using `core::mem::take`
--> tests/ui/mem_replace_no_std.rs:34:13
--> tests/ui/mem_replace_no_std.rs:33:13
|
LL | let _ = mem::replace(&mut slice, &[]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `core::mem::take(&mut slice)`
error: replacing an `Option` with `None`
--> tests/ui/mem_replace_no_std.rs:77:13
--> tests/ui/mem_replace_no_std.rs:76:13
|
LL | let _ = mem::replace(&mut f.0, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `f.0.take()`
error: replacing an `Option` with `None`
--> tests/ui/mem_replace_no_std.rs:78:13
--> tests/ui/mem_replace_no_std.rs:77:13
|
LL | let _ = mem::replace(&mut *f, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `(*f).take()`
error: replacing an `Option` with `None`
--> tests/ui/mem_replace_no_std.rs:79:13
--> tests/ui/mem_replace_no_std.rs:78:13
|
LL | let _ = mem::replace(&mut b.opt, None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `b.opt.take()`

View File

@ -1,5 +1,5 @@
#![warn(clippy::mismatching_type_param_order)]
#![allow(clippy::disallowed_names)]
#![allow(clippy::disallowed_names, clippy::needless_lifetimes)]
fn main() {
struct Foo<A, B> {

View File

@ -4,7 +4,8 @@
clippy::uninlined_format_args,
clippy::unnecessary_mut_passed,
clippy::unnecessary_to_owned,
clippy::unnecessary_literal_unwrap
clippy::unnecessary_literal_unwrap,
clippy::needless_lifetimes
)]
#![warn(clippy::needless_borrow)]

View File

@ -4,7 +4,8 @@
clippy::uninlined_format_args,
clippy::unnecessary_mut_passed,
clippy::unnecessary_to_owned,
clippy::unnecessary_literal_unwrap
clippy::unnecessary_literal_unwrap,
clippy::needless_lifetimes
)]
#![warn(clippy::needless_borrow)]

View File

@ -1,5 +1,5 @@
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:15:15
--> tests/ui/needless_borrow.rs:16:15
|
LL | let _ = x(&&a); // warn
| ^^^ help: change this to: `&a`
@ -8,163 +8,163 @@ LL | let _ = x(&&a); // warn
= help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:19:13
--> tests/ui/needless_borrow.rs:20:13
|
LL | mut_ref(&mut &mut b); // warn
| ^^^^^^^^^^^ help: change this to: `&mut b`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:31:13
--> tests/ui/needless_borrow.rs:32:13
|
LL | &&a
| ^^^ help: change this to: `&a`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:33:15
--> tests/ui/needless_borrow.rs:34:15
|
LL | 46 => &&a,
| ^^^ help: change this to: `&a`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:39:27
--> tests/ui/needless_borrow.rs:40:27
|
LL | break &ref_a;
| ^^^^^^ help: change this to: `ref_a`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:46:15
--> tests/ui/needless_borrow.rs:47:15
|
LL | let _ = x(&&&a);
| ^^^^ help: change this to: `&a`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:47:15
--> tests/ui/needless_borrow.rs:48:15
|
LL | let _ = x(&mut &&a);
| ^^^^^^^^ help: change this to: `&a`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:48:15
--> tests/ui/needless_borrow.rs:49:15
|
LL | let _ = x(&&&mut b);
| ^^^^^^^^ help: change this to: `&mut b`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:49:15
--> tests/ui/needless_borrow.rs:50:15
|
LL | let _ = x(&&ref_a);
| ^^^^^^^ help: change this to: `ref_a`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:52:11
--> tests/ui/needless_borrow.rs:53:11
|
LL | x(&b);
| ^^ help: change this to: `b`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:59:13
--> tests/ui/needless_borrow.rs:60:13
|
LL | mut_ref(&mut x);
| ^^^^^^ help: change this to: `x`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:60:13
--> tests/ui/needless_borrow.rs:61:13
|
LL | mut_ref(&mut &mut x);
| ^^^^^^^^^^^ help: change this to: `x`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:61:23
--> tests/ui/needless_borrow.rs:62:23
|
LL | let y: &mut i32 = &mut x;
| ^^^^^^ help: change this to: `x`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:62:23
--> tests/ui/needless_borrow.rs:63:23
|
LL | let y: &mut i32 = &mut &mut x;
| ^^^^^^^^^^^ help: change this to: `x`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:71:14
--> tests/ui/needless_borrow.rs:72:14
|
LL | 0 => &mut x,
| ^^^^^^ help: change this to: `x`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:77:14
--> tests/ui/needless_borrow.rs:78:14
|
LL | 0 => &mut x,
| ^^^^^^ help: change this to: `x`
error: this expression borrows a value the compiler would automatically borrow
--> tests/ui/needless_borrow.rs:89:13
--> tests/ui/needless_borrow.rs:90:13
|
LL | let _ = (&x).0;
| ^^^^ help: change this to: `x`
error: this expression borrows a value the compiler would automatically borrow
--> tests/ui/needless_borrow.rs:91:22
--> tests/ui/needless_borrow.rs:92:22
|
LL | let _ = unsafe { (&*x).0 };
| ^^^^^ help: change this to: `(*x)`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:101:5
--> tests/ui/needless_borrow.rs:102:5
|
LL | (&&()).foo();
| ^^^^^^ help: change this to: `(&())`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:110:5
--> tests/ui/needless_borrow.rs:111:5
|
LL | (&&5).foo();
| ^^^^^ help: change this to: `(&5)`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:136:23
--> tests/ui/needless_borrow.rs:137:23
|
LL | let x: (&str,) = (&"",);
| ^^^ help: change this to: `""`
error: this expression borrows a value the compiler would automatically borrow
--> tests/ui/needless_borrow.rs:178:13
--> tests/ui/needless_borrow.rs:179:13
|
LL | (&self.f)()
| ^^^^^^^^^ help: change this to: `(self.f)`
error: this expression borrows a value the compiler would automatically borrow
--> tests/ui/needless_borrow.rs:187:13
--> tests/ui/needless_borrow.rs:188:13
|
LL | (&mut self.f)()
| ^^^^^^^^^^^^^ help: change this to: `(self.f)`
error: this expression borrows a value the compiler would automatically borrow
--> tests/ui/needless_borrow.rs:224:22
--> tests/ui/needless_borrow.rs:225:22
|
LL | let _ = &mut (&mut { x.u }).x;
| ^^^^^^^^^^^^^^ help: change this to: `{ x.u }`
error: this expression borrows a value the compiler would automatically borrow
--> tests/ui/needless_borrow.rs:231:22
--> tests/ui/needless_borrow.rs:232:22
|
LL | let _ = &mut (&mut { x.u }).x;
| ^^^^^^^^^^^^^^ help: change this to: `{ x.u }`
error: this expression borrows a value the compiler would automatically borrow
--> tests/ui/needless_borrow.rs:235:22
--> tests/ui/needless_borrow.rs:236:22
|
LL | let _ = &mut (&mut x.u).x;
| ^^^^^^^^^^ help: change this to: `x.u`
error: this expression borrows a value the compiler would automatically borrow
--> tests/ui/needless_borrow.rs:236:22
--> tests/ui/needless_borrow.rs:237:22
|
LL | let _ = &mut (&mut { x.u }).x;
| ^^^^^^^^^^^^^^ help: change this to: `{ x.u }`
error: this expression creates a reference which is immediately dereferenced by the compiler
--> tests/ui/needless_borrow.rs:257:23
--> tests/ui/needless_borrow.rs:258:23
|
LL | option.unwrap_or((&x.0,));
| ^^^^ help: change this to: `x.0`

View File

@ -5,7 +5,8 @@
clippy::redundant_clone,
clippy::redundant_pattern_matching,
clippy::single_match,
clippy::uninlined_format_args
clippy::uninlined_format_args,
clippy::needless_lifetimes
)]
//@no-rustfix
use std::borrow::Borrow;

View File

@ -1,5 +1,5 @@
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:18:23
--> tests/ui/needless_pass_by_value.rs:19:23
|
LL | fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
| ^^^^^^ help: consider changing the type to: `&[T]`
@ -8,55 +8,55 @@ LL | fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T
= help: to override `-D warnings` add `#[allow(clippy::needless_pass_by_value)]`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:34:11
--> tests/ui/needless_pass_by_value.rs:35:11
|
LL | fn bar(x: String, y: Wrapper) {
| ^^^^^^ help: consider changing the type to: `&str`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:34:22
--> tests/ui/needless_pass_by_value.rs:35:22
|
LL | fn bar(x: String, y: Wrapper) {
| ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:42:71
--> tests/ui/needless_pass_by_value.rs:43:71
|
LL | fn test_borrow_trait<T: Borrow<str>, U: AsRef<str>, V>(t: T, u: U, v: V) {
| ^ help: consider taking a reference instead: `&V`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:55:18
--> tests/ui/needless_pass_by_value.rs:56:18
|
LL | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&Option<Option<String>>`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:69:24
--> tests/ui/needless_pass_by_value.rs:70:24
|
LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
| ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:69:36
--> tests/ui/needless_pass_by_value.rs:70:36
|
LL | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
| ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:87:49
--> tests/ui/needless_pass_by_value.rs:88:49
|
LL | fn test_blanket_ref<T: Foo, S: Serialize>(vals: T, serializable: S) {}
| ^ help: consider taking a reference instead: `&T`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:90:18
--> tests/ui/needless_pass_by_value.rs:91:18
|
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
| ^^^^^^ help: consider taking a reference instead: `&String`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:90:29
--> tests/ui/needless_pass_by_value.rs:91:29
|
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
| ^^^^^^
@ -71,13 +71,13 @@ LL | let _ = t.to_string();
| ~~~~~~~~~~~~~
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:90:40
--> tests/ui/needless_pass_by_value.rs:91:40
|
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
| ^^^^^^^^ help: consider taking a reference instead: `&Vec<i32>`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:90:53
--> tests/ui/needless_pass_by_value.rs:91:53
|
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
| ^^^^^^^^
@ -92,85 +92,85 @@ LL | let _ = v.to_owned();
| ~~~~~~~~~~~~
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:107:12
--> tests/ui/needless_pass_by_value.rs:108:12
|
LL | s: String,
| ^^^^^^ help: consider changing the type to: `&str`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:109:12
--> tests/ui/needless_pass_by_value.rs:110:12
|
LL | t: String,
| ^^^^^^ help: consider taking a reference instead: `&String`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:119:23
--> tests/ui/needless_pass_by_value.rs:120:23
|
LL | fn baz(&self, uu: U, ss: Self) {}
| ^ help: consider taking a reference instead: `&U`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:119:30
--> tests/ui/needless_pass_by_value.rs:120:30
|
LL | fn baz(&self, uu: U, ss: Self) {}
| ^^^^ help: consider taking a reference instead: `&Self`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:143:24
--> tests/ui/needless_pass_by_value.rs:144:24
|
LL | fn bar_copy(x: u32, y: CopyWrapper) {
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
|
help: or consider marking this type as `Copy`
--> tests/ui/needless_pass_by_value.rs:141:1
--> tests/ui/needless_pass_by_value.rs:142:1
|
LL | struct CopyWrapper(u32);
| ^^^^^^^^^^^^^^^^^^
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:150:29
--> tests/ui/needless_pass_by_value.rs:151:29
|
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
|
help: or consider marking this type as `Copy`
--> tests/ui/needless_pass_by_value.rs:141:1
--> tests/ui/needless_pass_by_value.rs:142:1
|
LL | struct CopyWrapper(u32);
| ^^^^^^^^^^^^^^^^^^
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:150:45
--> tests/ui/needless_pass_by_value.rs:151:45
|
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
|
help: or consider marking this type as `Copy`
--> tests/ui/needless_pass_by_value.rs:141:1
--> tests/ui/needless_pass_by_value.rs:142:1
|
LL | struct CopyWrapper(u32);
| ^^^^^^^^^^^^^^^^^^
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:150:61
--> tests/ui/needless_pass_by_value.rs:151:61
|
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
|
help: or consider marking this type as `Copy`
--> tests/ui/needless_pass_by_value.rs:141:1
--> tests/ui/needless_pass_by_value.rs:142:1
|
LL | struct CopyWrapper(u32);
| ^^^^^^^^^^^^^^^^^^
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:165:40
--> tests/ui/needless_pass_by_value.rs:166:40
|
LL | fn some_fun<'b, S: Bar<'b, ()>>(items: S) {}
| ^ help: consider taking a reference instead: `&S`
error: this argument is passed by value, but not consumed in the function body
--> tests/ui/needless_pass_by_value.rs:171:20
--> tests/ui/needless_pass_by_value.rs:172:20
|
LL | fn more_fun(items: impl Club<'static, i32>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider taking a reference instead: `&impl Club<'static, i32>`

View File

@ -2,7 +2,8 @@
dead_code,
clippy::missing_safety_doc,
clippy::extra_unused_lifetimes,
clippy::extra_unused_type_parameters
clippy::extra_unused_type_parameters,
clippy::needless_lifetimes
)]
#![warn(clippy::new_without_default)]

View File

@ -2,7 +2,8 @@
dead_code,
clippy::missing_safety_doc,
clippy::extra_unused_lifetimes,
clippy::extra_unused_type_parameters
clippy::extra_unused_type_parameters,
clippy::needless_lifetimes
)]
#![warn(clippy::new_without_default)]

View File

@ -1,5 +1,5 @@
error: you should consider adding a `Default` implementation for `Foo`
--> tests/ui/new_without_default.rs:12:5
--> tests/ui/new_without_default.rs:13:5
|
LL | / pub fn new() -> Foo {
LL | |
@ -20,7 +20,7 @@ LL + }
|
error: you should consider adding a `Default` implementation for `Bar`
--> tests/ui/new_without_default.rs:22:5
--> tests/ui/new_without_default.rs:23:5
|
LL | / pub fn new() -> Self {
LL | |
@ -38,7 +38,7 @@ LL + }
|
error: you should consider adding a `Default` implementation for `LtKo<'c>`
--> tests/ui/new_without_default.rs:87:5
--> tests/ui/new_without_default.rs:88:5
|
LL | / pub fn new() -> LtKo<'c> {
LL | |
@ -56,7 +56,7 @@ LL + }
|
error: you should consider adding a `Default` implementation for `Const`
--> tests/ui/new_without_default.rs:120:5
--> tests/ui/new_without_default.rs:121:5
|
LL | / pub const fn new() -> Const {
LL | | Const
@ -73,7 +73,7 @@ LL + }
|
error: you should consider adding a `Default` implementation for `NewNotEqualToDerive`
--> tests/ui/new_without_default.rs:180:5
--> tests/ui/new_without_default.rs:181:5
|
LL | / pub fn new() -> Self {
LL | |
@ -91,7 +91,7 @@ LL + }
|
error: you should consider adding a `Default` implementation for `FooGenerics<T>`
--> tests/ui/new_without_default.rs:189:5
--> tests/ui/new_without_default.rs:190:5
|
LL | / pub fn new() -> Self {
LL | |
@ -109,7 +109,7 @@ LL + }
|
error: you should consider adding a `Default` implementation for `BarGenerics<T>`
--> tests/ui/new_without_default.rs:197:5
--> tests/ui/new_without_default.rs:198:5
|
LL | / pub fn new() -> Self {
LL | |
@ -127,7 +127,7 @@ LL + }
|
error: you should consider adding a `Default` implementation for `Foo<T>`
--> tests/ui/new_without_default.rs:209:9
--> tests/ui/new_without_default.rs:210:9
|
LL | / pub fn new() -> Self {
LL | |
@ -147,7 +147,7 @@ LL ~ impl<T> Foo<T> {
|
error: you should consider adding a `Default` implementation for `MyStruct<K, V>`
--> tests/ui/new_without_default.rs:255:5
--> tests/ui/new_without_default.rs:256:5
|
LL | / pub fn new() -> Self {
LL | | Self { _kv: None }

View File

@ -1,5 +1,5 @@
#![warn(clippy::ref_as_ptr)]
#![allow(clippy::unnecessary_mut_passed)]
#![allow(clippy::unnecessary_mut_passed, clippy::needless_lifetimes)]
fn f<T>(_: T) {}

View File

@ -1,5 +1,5 @@
#![warn(clippy::ref_as_ptr)]
#![allow(clippy::unnecessary_mut_passed)]
#![allow(clippy::unnecessary_mut_passed, clippy::needless_lifetimes)]
fn f<T>(_: T) {}

View File

@ -1,5 +1,5 @@
#![warn(clippy::serde_api_misuse)]
#![allow(dead_code)]
#![allow(dead_code, clippy::needless_lifetimes)]
extern crate serde;

View File

@ -2,7 +2,12 @@
//@no-rustfix
#![warn(clippy::significant_drop_in_scrutinee)]
#![allow(dead_code, unused_assignments)]
#![allow(clippy::match_single_binding, clippy::single_match, clippy::uninlined_format_args)]
#![allow(
clippy::match_single_binding,
clippy::single_match,
clippy::uninlined_format_args,
clippy::needless_lifetimes
)]
use std::num::ParseIntError;
use std::ops::Deref;

View File

@ -1,5 +1,5 @@
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:55:11
--> tests/ui/significant_drop_in_scrutinee.rs:60:11
|
LL | match mutex.lock().unwrap().foo() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -20,7 +20,7 @@ LL ~ match value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:143:11
--> tests/ui/significant_drop_in_scrutinee.rs:148:11
|
LL | match s.lock_m().get_the_value() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -42,7 +42,7 @@ LL ~ match value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:166:11
--> tests/ui/significant_drop_in_scrutinee.rs:171:11
|
LL | match s.lock_m_m().get_the_value() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -64,7 +64,7 @@ LL ~ match value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:216:11
--> tests/ui/significant_drop_in_scrutinee.rs:221:11
|
LL | match counter.temp_increment().len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -80,7 +80,7 @@ LL ~ match value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:241:16
--> tests/ui/significant_drop_in_scrutinee.rs:246:16
|
LL | match (mutex1.lock().unwrap().s.len(), true) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -99,7 +99,7 @@ LL ~ match (value, true) {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:252:22
--> tests/ui/significant_drop_in_scrutinee.rs:257:22
|
LL | match (true, mutex1.lock().unwrap().s.len(), true) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -118,7 +118,7 @@ LL ~ match (true, value, true) {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:264:16
--> tests/ui/significant_drop_in_scrutinee.rs:269:16
|
LL | match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -139,7 +139,7 @@ LL ~ match (value, true, mutex2.lock().unwrap().s.len()) {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:264:54
--> tests/ui/significant_drop_in_scrutinee.rs:269:54
|
LL | match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -160,7 +160,7 @@ LL ~ match (mutex1.lock().unwrap().s.len(), true, value) {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:319:11
--> tests/ui/significant_drop_in_scrutinee.rs:324:11
|
LL | match mutex.lock().unwrap().s.len() > 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -179,7 +179,7 @@ LL ~ match value > 1 {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:328:15
--> tests/ui/significant_drop_in_scrutinee.rs:333:15
|
LL | match 1 < mutex.lock().unwrap().s.len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -198,7 +198,7 @@ LL ~ match 1 < value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:348:11
--> tests/ui/significant_drop_in_scrutinee.rs:353:11
|
LL | match mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -219,7 +219,7 @@ LL ~ match value < mutex2.lock().unwrap().s.len() {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:348:44
--> tests/ui/significant_drop_in_scrutinee.rs:353:44
|
LL | match mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -240,7 +240,7 @@ LL ~ match mutex1.lock().unwrap().s.len() < value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:361:11
--> tests/ui/significant_drop_in_scrutinee.rs:366:11
|
LL | match mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -261,7 +261,7 @@ LL ~ match value >= mutex2.lock().unwrap().s.len() {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:361:45
--> tests/ui/significant_drop_in_scrutinee.rs:366:45
|
LL | match mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -282,7 +282,7 @@ LL ~ match mutex1.lock().unwrap().s.len() >= value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:398:11
--> tests/ui/significant_drop_in_scrutinee.rs:403:11
|
LL | match get_mutex_guard().s.len() > 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -301,7 +301,7 @@ LL ~ match value > 1 {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:417:11
--> tests/ui/significant_drop_in_scrutinee.rs:422:11
|
LL | match match i {
| ___________^
@ -334,7 +334,7 @@ LL ~ match value
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:445:11
--> tests/ui/significant_drop_in_scrutinee.rs:450:11
|
LL | match if i > 1 {
| ___________^
@ -368,7 +368,7 @@ LL ~ match value
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:501:11
--> tests/ui/significant_drop_in_scrutinee.rs:506:11
|
LL | match s.lock().deref().deref() {
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -386,7 +386,7 @@ LL ~ match (&value) {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:551:11
--> tests/ui/significant_drop_in_scrutinee.rs:556:11
|
LL | match mutex.lock().unwrap().i = i {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -405,7 +405,7 @@ LL ~ match () {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:559:15
--> tests/ui/significant_drop_in_scrutinee.rs:564:15
|
LL | match i = mutex.lock().unwrap().i {
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -424,7 +424,7 @@ LL ~ match i = value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:567:11
--> tests/ui/significant_drop_in_scrutinee.rs:572:11
|
LL | match mutex.lock().unwrap().i += 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -443,7 +443,7 @@ LL ~ match () {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:575:16
--> tests/ui/significant_drop_in_scrutinee.rs:580:16
|
LL | match i += mutex.lock().unwrap().i {
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -462,7 +462,7 @@ LL ~ match i += value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:640:11
--> tests/ui/significant_drop_in_scrutinee.rs:645:11
|
LL | match rwlock.read().unwrap().to_number() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -478,7 +478,7 @@ LL ~ match value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:668:11
--> tests/ui/significant_drop_in_scrutinee.rs:673:11
|
LL | match mutex.lock().unwrap().foo() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -494,7 +494,7 @@ LL ~ match value {
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
--> tests/ui/significant_drop_in_scrutinee.rs:731:11
--> tests/ui/significant_drop_in_scrutinee.rs:736:11
|
LL | match guard.take().len() {
| ^^^^^^^^^^^^^^^^^^
@ -510,7 +510,7 @@ LL ~ match value {
|
error: temporary with significant `Drop` in `for` loop condition will live until the end of the `for` expression
--> tests/ui/significant_drop_in_scrutinee.rs:757:16
--> tests/ui/significant_drop_in_scrutinee.rs:762:16
|
LL | for val in mutex.lock().unwrap().copy_old_lifetime() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -526,7 +526,7 @@ LL ~ for val in value {
|
error: temporary with significant `Drop` in `for` loop condition will live until the end of the `for` expression
--> tests/ui/significant_drop_in_scrutinee.rs:797:17
--> tests/ui/significant_drop_in_scrutinee.rs:802:17
|
LL | for val in [mutex.lock().unwrap()[0], 2] {
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -542,7 +542,7 @@ LL ~ for val in [value, 2] {
|
error: temporary with significant `Drop` in `if let` scrutinee will live until the end of the `if let` expression
--> tests/ui/significant_drop_in_scrutinee.rs:807:24
--> tests/ui/significant_drop_in_scrutinee.rs:812:24
|
LL | if let Some(val) = mutex.lock().unwrap().first().copied() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -558,7 +558,7 @@ LL ~ if let Some(val) = value {
|
error: temporary with significant `Drop` in `while let` scrutinee will live until the end of the `while let` expression
--> tests/ui/significant_drop_in_scrutinee.rs:823:27
--> tests/ui/significant_drop_in_scrutinee.rs:828:27
|
LL | while let Some(val) = mutex.lock().unwrap().pop() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,4 +1,5 @@
#![warn(clippy::str_split_at_newline)]
#![allow(clippy::needless_lifetimes)]
use core::str::Split;
use std::ops::Deref;

View File

@ -1,4 +1,5 @@
#![warn(clippy::str_split_at_newline)]
#![allow(clippy::needless_lifetimes)]
use core::str::Split;
use std::ops::Deref;

View File

@ -1,5 +1,5 @@
error: using `str.trim().split()` with hard-coded newlines
--> tests/ui/str_split.rs:59:13
--> tests/ui/str_split.rs:60:13
|
LL | let _ = s1.trim().split('\n');
| ^^^^^^^^^^^^^^^^^^^^^ help: use `str.lines()` instead: `s1.lines()`
@ -8,55 +8,55 @@ LL | let _ = s1.trim().split('\n');
= help: to override `-D warnings` add `#[allow(clippy::str_split_at_newline)]`
error: using `str.trim().split()` with hard-coded newlines
--> tests/ui/str_split.rs:61:13
--> tests/ui/str_split.rs:62:13
|
LL | let _ = s1.trim().split("\n");
| ^^^^^^^^^^^^^^^^^^^^^ help: use `str.lines()` instead: `s1.lines()`
error: using `str.trim().split()` with hard-coded newlines
--> tests/ui/str_split.rs:62:13
--> tests/ui/str_split.rs:63:13
|
LL | let _ = s1.trim().split("\r\n");
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `str.lines()` instead: `s1.lines()`
error: using `str.trim().split()` with hard-coded newlines
--> tests/ui/str_split.rs:65:13
--> tests/ui/str_split.rs:66:13
|
LL | let _ = s2.trim().split('\n');
| ^^^^^^^^^^^^^^^^^^^^^ help: use `str.lines()` instead: `s2.lines()`
error: using `str.trim().split()` with hard-coded newlines
--> tests/ui/str_split.rs:67:13
--> tests/ui/str_split.rs:68:13
|
LL | let _ = s2.trim().split("\n");
| ^^^^^^^^^^^^^^^^^^^^^ help: use `str.lines()` instead: `s2.lines()`
error: using `str.trim().split()` with hard-coded newlines
--> tests/ui/str_split.rs:68:13
--> tests/ui/str_split.rs:69:13
|
LL | let _ = s2.trim().split("\r\n");
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `str.lines()` instead: `s2.lines()`
error: using `str.trim().split()` with hard-coded newlines
--> tests/ui/str_split.rs:72:13
--> tests/ui/str_split.rs:73:13
|
LL | let _ = s3.trim().split('\n');
| ^^^^^^^^^^^^^^^^^^^^^ help: use `str.lines()` instead: `s3.lines()`
error: using `str.trim().split()` with hard-coded newlines
--> tests/ui/str_split.rs:74:13
--> tests/ui/str_split.rs:75:13
|
LL | let _ = s3.trim().split("\n");
| ^^^^^^^^^^^^^^^^^^^^^ help: use `str.lines()` instead: `s3.lines()`
error: using `str.trim().split()` with hard-coded newlines
--> tests/ui/str_split.rs:75:13
--> tests/ui/str_split.rs:76:13
|
LL | let _ = s3.trim().split("\r\n");
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `str.lines()` instead: `s3.lines()`
error: using `str.trim().split()` with hard-coded newlines
--> tests/ui/str_split.rs:78:13
--> tests/ui/str_split.rs:79:13
|
LL | let _ = make_str!(s1).trim().split('\n');
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `str.lines()` instead: `make_str!(s1).lines()`

View File

@ -1,4 +1,5 @@
#![warn(clippy::temporary_assignment)]
#![allow(clippy::needless_lifetimes)]
use std::ops::{Deref, DerefMut};

View File

@ -1,5 +1,5 @@
error: assignment to temporary
--> tests/ui/temporary_assignment.rs:47:5
--> tests/ui/temporary_assignment.rs:48:5
|
LL | Struct { field: 0 }.field = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | Struct { field: 0 }.field = 1;
= help: to override `-D warnings` add `#[allow(clippy::temporary_assignment)]`
error: assignment to temporary
--> tests/ui/temporary_assignment.rs:50:5
--> tests/ui/temporary_assignment.rs:51:5
|
LL | / MultiStruct {
LL | |
@ -19,13 +19,13 @@ LL | | .field = 1;
| |______________^
error: assignment to temporary
--> tests/ui/temporary_assignment.rs:56:5
--> tests/ui/temporary_assignment.rs:57:5
|
LL | ArrayStruct { array: [0] }.array[0] = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: assignment to temporary
--> tests/ui/temporary_assignment.rs:58:5
--> tests/ui/temporary_assignment.rs:59:5
|
LL | (0, 0).0 = 1;
| ^^^^^^^^^^^^

View File

@ -4,7 +4,8 @@
#![allow(
clippy::partialeq_ne_impl,
clippy::default_constructed_unit_structs,
clippy::only_used_in_recursion
clippy::only_used_in_recursion,
clippy::needless_lifetimes
)]
enum Foo {

View File

@ -1,5 +1,5 @@
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:46:5
--> tests/ui/unconditional_recursion.rs:47:5
|
LL | fn ne(&self, other: &Self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
@ -12,7 +12,7 @@ LL | self.ne(other)
= help: to override `-D warnings` add `#[allow(unconditional_recursion)]`
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:50:5
--> tests/ui/unconditional_recursion.rs:51:5
|
LL | fn eq(&self, other: &Self) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
@ -23,7 +23,7 @@ LL | self.eq(other)
= help: a `loop` may express intention better if this is on purpose
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:215:5
--> tests/ui/unconditional_recursion.rs:216:5
|
LL | fn to_string(&self) -> String {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
@ -34,7 +34,7 @@ LL | self.to_string()
= help: a `loop` may express intention better if this is on purpose
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:225:5
--> tests/ui/unconditional_recursion.rs:226:5
|
LL | fn to_string(&self) -> String {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
@ -45,7 +45,7 @@ LL | x.to_string()
= help: a `loop` may express intention better if this is on purpose
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:236:5
--> tests/ui/unconditional_recursion.rs:237:5
|
LL | fn to_string(&self) -> String {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
@ -56,7 +56,7 @@ LL | (self as &Self).to_string()
= help: a `loop` may express intention better if this is on purpose
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:16:5
--> tests/ui/unconditional_recursion.rs:17:5
|
LL | / fn ne(&self, other: &Self) -> bool {
LL | |
@ -65,7 +65,7 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:18:9
--> tests/ui/unconditional_recursion.rs:19:9
|
LL | self != other
| ^^^^^^^^^^^^^
@ -73,7 +73,7 @@ LL | self != other
= help: to override `-D warnings` add `#[allow(clippy::unconditional_recursion)]`
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:20:5
--> tests/ui/unconditional_recursion.rs:21:5
|
LL | / fn eq(&self, other: &Self) -> bool {
LL | |
@ -82,13 +82,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:22:9
--> tests/ui/unconditional_recursion.rs:23:9
|
LL | self == other
| ^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:32:5
--> tests/ui/unconditional_recursion.rs:33:5
|
LL | / fn ne(&self, other: &Self) -> bool {
LL | | self != &Foo2::B // no error here
@ -96,13 +96,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:33:9
--> tests/ui/unconditional_recursion.rs:34:9
|
LL | self != &Foo2::B // no error here
| ^^^^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:35:5
--> tests/ui/unconditional_recursion.rs:36:5
|
LL | / fn eq(&self, other: &Self) -> bool {
LL | | self == &Foo2::B // no error here
@ -110,13 +110,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:36:9
--> tests/ui/unconditional_recursion.rs:37:9
|
LL | self == &Foo2::B // no error here
| ^^^^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:46:5
--> tests/ui/unconditional_recursion.rs:47:5
|
LL | / fn ne(&self, other: &Self) -> bool {
LL | |
@ -125,13 +125,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:48:9
--> tests/ui/unconditional_recursion.rs:49:9
|
LL | self.ne(other)
| ^^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:50:5
--> tests/ui/unconditional_recursion.rs:51:5
|
LL | / fn eq(&self, other: &Self) -> bool {
LL | |
@ -140,13 +140,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:52:9
--> tests/ui/unconditional_recursion.rs:53:9
|
LL | self.eq(other)
| ^^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:94:5
--> tests/ui/unconditional_recursion.rs:95:5
|
LL | / fn ne(&self, other: &Self) -> bool {
LL | |
@ -155,13 +155,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:96:9
--> tests/ui/unconditional_recursion.rs:97:9
|
LL | other != self
| ^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:98:5
--> tests/ui/unconditional_recursion.rs:99:5
|
LL | / fn eq(&self, other: &Self) -> bool {
LL | |
@ -170,13 +170,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:100:9
--> tests/ui/unconditional_recursion.rs:101:9
|
LL | other == self
| ^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:108:5
--> tests/ui/unconditional_recursion.rs:109:5
|
LL | / fn ne(&self, other: &Self) -> bool {
LL | |
@ -185,13 +185,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:110:9
--> tests/ui/unconditional_recursion.rs:111:9
|
LL | other != other
| ^^^^^^^^^^^^^^
error: equal expressions as operands to `!=`
--> tests/ui/unconditional_recursion.rs:110:9
--> tests/ui/unconditional_recursion.rs:111:9
|
LL | other != other
| ^^^^^^^^^^^^^^
@ -199,7 +199,7 @@ LL | other != other
= note: `#[deny(clippy::eq_op)]` on by default
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:112:5
--> tests/ui/unconditional_recursion.rs:113:5
|
LL | / fn eq(&self, other: &Self) -> bool {
LL | |
@ -208,19 +208,19 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:114:9
--> tests/ui/unconditional_recursion.rs:115:9
|
LL | other == other
| ^^^^^^^^^^^^^^
error: equal expressions as operands to `==`
--> tests/ui/unconditional_recursion.rs:114:9
--> tests/ui/unconditional_recursion.rs:115:9
|
LL | other == other
| ^^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:121:5
--> tests/ui/unconditional_recursion.rs:122:5
|
LL | / fn ne(&self, _other: &Self) -> bool {
LL | |
@ -229,19 +229,19 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:123:9
--> tests/ui/unconditional_recursion.rs:124:9
|
LL | self != self
| ^^^^^^^^^^^^
error: equal expressions as operands to `!=`
--> tests/ui/unconditional_recursion.rs:123:9
--> tests/ui/unconditional_recursion.rs:124:9
|
LL | self != self
| ^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:125:5
--> tests/ui/unconditional_recursion.rs:126:5
|
LL | / fn eq(&self, _other: &Self) -> bool {
LL | |
@ -250,19 +250,19 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:127:9
--> tests/ui/unconditional_recursion.rs:128:9
|
LL | self == self
| ^^^^^^^^^^^^
error: equal expressions as operands to `==`
--> tests/ui/unconditional_recursion.rs:127:9
--> tests/ui/unconditional_recursion.rs:128:9
|
LL | self == self
| ^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:153:13
--> tests/ui/unconditional_recursion.rs:154:13
|
LL | / fn eq(&self, other: &Self) -> bool {
LL | |
@ -274,7 +274,7 @@ LL | impl_partial_eq!(S5);
| -------------------- in this macro invocation
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:155:17
--> tests/ui/unconditional_recursion.rs:156:17
|
LL | self == other
| ^^^^^^^^^^^^^
@ -284,7 +284,7 @@ LL | impl_partial_eq!(S5);
= note: this error originates in the macro `impl_partial_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:182:5
--> tests/ui/unconditional_recursion.rs:183:5
|
LL | / fn eq(&self, other: &Self) -> bool {
LL | |
@ -295,13 +295,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:186:9
--> tests/ui/unconditional_recursion.rs:187:9
|
LL | mine == theirs
| ^^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:251:5
--> tests/ui/unconditional_recursion.rs:252:5
|
LL | / fn new() -> Self {
LL | |
@ -310,13 +310,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:253:9
--> tests/ui/unconditional_recursion.rs:254:9
|
LL | Self::default()
| ^^^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:290:5
--> tests/ui/unconditional_recursion.rs:291:5
|
LL | / fn eq(&self, other: &Self) -> bool {
LL | |
@ -327,13 +327,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:294:9
--> tests/ui/unconditional_recursion.rs:295:9
|
LL | mine.eq(theirs)
| ^^^^^^^^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:361:5
--> tests/ui/unconditional_recursion.rs:362:5
|
LL | / fn from(f: BadFromTy1<'a>) -> Self {
LL | | f.into()
@ -341,13 +341,13 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:362:9
--> tests/ui/unconditional_recursion.rs:363:9
|
LL | f.into()
| ^^^^^^^^
error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:370:5
--> tests/ui/unconditional_recursion.rs:371:5
|
LL | / fn from(f: BadFromTy2<'a>) -> Self {
LL | | Into::into(f)
@ -355,7 +355,7 @@ LL | | }
| |_____^
|
note: recursive call site
--> tests/ui/unconditional_recursion.rs:371:9
--> tests/ui/unconditional_recursion.rs:372:9
|
LL | Into::into(f)
| ^^^^^^^^^^^^^

View File

@ -1,4 +1,5 @@
#![deny(clippy::useless_asref)]
#![allow(clippy::needless_lifetimes)]
trait Trait {
fn as_ptr(&self);