rust-clippy/tests/ui/explicit_auto_deref.stderr

281 lines
8.1 KiB
Text

error: deref which would be done by auto-deref
--> tests/ui/explicit_auto_deref.rs:69:19
|
LL | let _: &str = &*s;
| ^^^ help: try: `&s`
|
= note: `-D clippy::explicit-auto-deref` implied by `-D warnings`
= 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: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: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:75:11
|
LL | f_str(&*s);
| ^^^ help: try: `&s`
error: deref which would be done by auto-deref
--> 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: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:88:7
|
LL | c(&*s);
| ^^^ help: try: `&s`
error: deref which would be done by auto-deref
--> 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:98:11
|
LL | { &**x }
| ^^^^ help: try: `x`
error: deref which would be done by auto-deref
--> 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:106:9
|
LL | &***x
| ^^^^^ help: try: `x`
error: deref which would be done by auto-deref
--> 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:124:12
|
LL | f2(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> 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: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:127:12
|
LL | f5(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> 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: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: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:131:12
|
LL | f9(&*x);
| ^^^ help: try: `&x`
error: deref which would be done by auto-deref
--> 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: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:137:16
|
LL | let _ = S1(&*s);
| ^^^ help: try: `&s`
error: deref which would be done by auto-deref
--> 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: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: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: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: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:181:13
|
LL | let _ = (*b).foo;
| ^^^^ help: try: `b`
error: deref which would be done by auto-deref
--> 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: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: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: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: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: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:238:9
|
LL | &**x
| ^^^^ help: try: `x`
error: deref which would be done by auto-deref
--> 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:264:20
|
LL | return *x;
| ^^ help: try: `x`
error: deref which would be done by auto-deref
--> 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: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: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: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: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: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: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:368:13
|
LL | foo(&*wrapped_bar);
| ^^^^^^^^^^^^^ help: try: `&wrapped_bar`
error: aborting due to 46 previous errors