rust/tests/ui/explicit_auto_deref.stderr

239 lines
6.6 KiB
Plaintext
Raw Normal View History

2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:68:19
2022-01-26 21:47:09 -06:00
|
LL | let _: &str = &*s;
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&s`
2022-01-26 21:47:09 -06:00
|
= note: `-D clippy::explicit-auto-deref` implied by `-D warnings`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:69:19
|
LL | let _: &str = &*{ String::new() };
2023-07-01 06:08:01 -05:00
| ^^^^^^^^^^^^^^^^^^^ help: try: `&{ String::new() }`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:70:19
|
LL | let _: &str = &mut *{ String::new() };
2023-07-01 06:08:01 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut { String::new() }`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:74:11
2022-01-26 21:47:09 -06:00
|
LL | f_str(&*s);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&s`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:78:13
2022-01-26 21:47:09 -06:00
|
LL | f_str_t(&*s, &*s); // Don't lint second param.
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&s`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:81:24
2022-01-26 21:47:09 -06:00
|
LL | let _: &Box<i32> = &**b;
2023-07-01 06:08:01 -05:00
| ^^^^ help: try: `&b`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:87:7
2022-01-26 21:47:09 -06:00
|
LL | c(&*s);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&s`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:93:9
2022-01-26 21:47:09 -06:00
|
LL | &**x
2023-07-01 06:08:01 -05:00
| ^^^^ help: try: `x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:97:11
2022-01-26 21:47:09 -06:00
|
LL | { &**x }
2023-07-01 06:08:01 -05:00
| ^^^^ help: try: `x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:101:9
2022-01-26 21:47:09 -06:00
|
LL | &**{ x }
2023-07-01 06:08:01 -05:00
| ^^^^^^^^ help: try: `{ x }`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:105:9
2022-01-26 21:47:09 -06:00
|
LL | &***x
2023-07-01 06:08:01 -05:00
| ^^^^^ help: try: `x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:122:12
2022-01-26 21:47:09 -06:00
|
LL | f1(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:123:12
2022-01-26 21:47:09 -06:00
|
LL | f2(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:124:12
2022-01-26 21:47:09 -06:00
|
LL | f3(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:125:27
2022-01-26 21:47:09 -06:00
|
LL | f4.callable_str()(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:126:12
2022-01-26 21:47:09 -06:00
|
LL | f5(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:127:12
2022-01-26 21:47:09 -06:00
|
LL | f6(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:128:27
2022-01-26 21:47:09 -06:00
|
LL | f7.callable_str()(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:129:25
2022-01-26 21:47:09 -06:00
|
LL | f8.callable_t()(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:130:12
2022-01-26 21:47:09 -06:00
|
LL | f9(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:131:13
2022-01-26 21:47:09 -06:00
|
LL | f10(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:132:26
2022-01-26 21:47:09 -06:00
|
LL | f11.callable_t()(&*x);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&x`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:136:16
2022-01-26 21:47:09 -06:00
|
LL | let _ = S1(&*s);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&s`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:141:21
2022-01-26 21:47:09 -06:00
|
LL | let _ = S2 { s: &*s };
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&s`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:157:30
2022-01-26 21:47:09 -06:00
|
LL | let _ = Self::S1(&**s);
2023-07-01 06:08:01 -05:00
| ^^^^ help: try: `s`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:158:35
2022-01-26 21:47:09 -06:00
|
LL | let _ = Self::S2 { s: &**s };
2023-07-01 06:08:01 -05:00
| ^^^^ help: try: `s`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:161:20
2022-01-26 21:47:09 -06:00
|
LL | let _ = E1::S1(&*s);
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&s`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:162:25
2022-01-26 21:47:09 -06:00
|
LL | let _ = E1::S2 { s: &*s };
2023-07-01 06:08:01 -05:00
| ^^^ help: try: `&s`
2022-01-26 21:47:09 -06:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:180:13
|
LL | let _ = (*b).foo;
2023-07-01 06:08:01 -05:00
| ^^^^ help: try: `b`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:181:13
|
LL | let _ = (**b).foo;
2023-07-01 06:08:01 -05:00
| ^^^^^ help: try: `b`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:196:19
|
LL | let _ = f_str(*ref_str);
2023-07-01 06:08:01 -05:00
| ^^^^^^^^ help: try: `ref_str`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:198:19
|
LL | let _ = f_str(**ref_ref_str);
2023-07-01 06:08:01 -05:00
| ^^^^^^^^^^^^^ help: try: `ref_ref_str`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:208:13
|
LL | f_str(&&*ref_str); // `needless_borrow` will suggest removing both references
2023-07-01 06:08:01 -05:00
| ^^^^^^^^ help: try: `ref_str`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:209:12
|
LL | f_str(&&**ref_str); // `needless_borrow` will suggest removing only one reference
2023-07-01 06:08:01 -05:00
| ^^^^^^^^^^ help: try: `ref_str`
2022-07-01 23:59:58 -05:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:218:41
2022-07-01 23:59:58 -05:00
|
LL | let _ = || -> &'static str { return *s };
2023-07-01 06:08:01 -05:00
| ^^ help: try: `s`
2022-07-01 23:59:58 -05:00
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:237:9
|
LL | &**x
2023-07-01 06:08:01 -05:00
| ^^^^ help: try: `x`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:260:8
|
LL | c1(*x);
2023-07-01 06:08:01 -05:00
| ^^ help: try: `x`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:263:20
|
LL | return *x;
2023-07-01 06:08:01 -05:00
| ^^ help: try: `x`
error: deref which would be done by auto-deref
2023-07-27 06:40:22 -05:00
--> $DIR/explicit_auto_deref.rs:265:9
|
LL | *x
2023-07-01 06:08:01 -05:00
| ^^ help: try: `x`
error: aborting due to 39 previous errors
2022-01-26 21:47:09 -06:00