File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ fn main() {
28
28
let _: String = "foo" . into ( ) ;
29
29
let _: String = From :: from ( "foo" ) ;
30
30
let _ = String :: from ( "foo" ) ;
31
+ #[ allow( identity_conversion) ]
32
+ {
33
+ let _: String = "foo" . into ( ) ;
34
+ let _ = String :: from ( "foo" ) ;
35
+ }
31
36
32
37
let _: String = "foo" . to_string ( ) . into ( ) ;
33
38
let _: String = From :: from ( "foo" . to_string ( ) ) ;
Original file line number Diff line number Diff line change @@ -23,20 +23,20 @@ error: identical conversion
23
23
| ^^^^^^^^^^^ help: consider removing `.into()`: `0i32`
24
24
25
25
error: identical conversion
26
- --> $DIR/identity_conversion.rs:32 :21
26
+ --> $DIR/identity_conversion.rs:37 :21
27
27
|
28
- 32 | let _: String = "foo".to_string().into();
28
+ 37 | let _: String = "foo".to_string().into();
29
29
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"foo".to_string()`
30
30
31
31
error: identical conversion
32
- --> $DIR/identity_conversion.rs:33 :21
32
+ --> $DIR/identity_conversion.rs:38 :21
33
33
|
34
- 33 | let _: String = From::from("foo".to_string());
34
+ 38 | let _: String = From::from("foo".to_string());
35
35
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `From::from()`: `"foo".to_string()`
36
36
37
37
error: identical conversion
38
- --> $DIR/identity_conversion.rs:34 :13
38
+ --> $DIR/identity_conversion.rs:39 :13
39
39
|
40
- 34 | let _ = String::from("foo".to_string());
40
+ 39 | let _ = String::from("foo".to_string());
41
41
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `"foo".to_string()`
42
42
You can’t perform that action at this time.
0 commit comments