]> git.lizzy.rs Git - rust.git/commitdiff
Test if #[allow] works
authorsinkuu <sinkuu@sinkuu.xyz>
Wed, 4 Oct 2017 13:26:41 +0000 (22:26 +0900)
committersinkuu <sinkuu@sinkuu.xyz>
Wed, 4 Oct 2017 13:26:41 +0000 (22:26 +0900)
tests/ui/identity_conversion.rs
tests/ui/identity_conversion.stderr

index 81cbdd9643a46bf5702f5b78a5edb166b8f109f1..d254b746d79fe4e79a1cd2a76890f581e7cad6d1 100644 (file)
@@ -28,6 +28,11 @@ fn main() {
     let _: String = "foo".into();
     let _: String = From::from("foo");
     let _ = String::from("foo");
+    #[allow(identity_conversion)]
+    {
+        let _: String = "foo".into();
+        let _ = String::from("foo");
+    }
 
     let _: String = "foo".to_string().into();
     let _: String = From::from("foo".to_string());
index 8e8d8a701249ef502b4e9d08a42e2c039fc7445d..152bb8882bdaaa013f353618b6a3df9b060b8118 100644 (file)
@@ -23,20 +23,20 @@ error: identical conversion
    |                      ^^^^^^^^^^^ help: consider removing `.into()`: `0i32`
 
 error: identical conversion
-  --> $DIR/identity_conversion.rs:32:21
+  --> $DIR/identity_conversion.rs:37:21
    |
-32 |     let _: String = "foo".to_string().into();
+37 |     let _: String = "foo".to_string().into();
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"foo".to_string()`
 
 error: identical conversion
-  --> $DIR/identity_conversion.rs:33:21
+  --> $DIR/identity_conversion.rs:38:21
    |
-33 |     let _: String = From::from("foo".to_string());
+38 |     let _: String = From::from("foo".to_string());
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `From::from()`: `"foo".to_string()`
 
 error: identical conversion
-  --> $DIR/identity_conversion.rs:34:13
+  --> $DIR/identity_conversion.rs:39:13
    |
-34 |     let _ = String::from("foo".to_string());
+39 |     let _ = String::from("foo".to_string());
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `"foo".to_string()`