]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/panic.rs
iterate List by value
[rust.git] / tests / ui / panic.rs
index 03d3c3dc2d947a2b4f2f1dcb36d31c01bb740c57..6e004aa9a924ffff0d7160eec504a5140051c4b0 100644 (file)
@@ -1,8 +1,5 @@
-#![feature(plugin)]
-#![plugin(clippy)]
-
-#![warn(panic_params)]
-
+#![warn(clippy::panic_params)]
+#![allow(clippy::assertions_on_constants)]
 fn missing() {
     if true {
         panic!("{}");
@@ -11,6 +8,8 @@ fn missing() {
     } else {
         assert!(true, "here be missing values: {}");
     }
+
+    panic!("{{{this}}}");
 }
 
 fn ok_single() {
@@ -34,13 +33,23 @@ fn ok_bracket() {
     }
 }
 
-const ONE : u32= 1;
+const ONE: u32 = 1;
 
 fn ok_nomsg() {
     assert!({ 1 == ONE });
     assert!(if 1 == ONE { ONE == 1 } else { false });
 }
 
+fn ok_escaped() {
+    panic!("{{ why should this not be ok? }}");
+    panic!(" or {{ that ?");
+    panic!(" or }} this ?");
+    panic!(" {or {{ that ?");
+    panic!(" }or }} this ?");
+    panic!("{{ test }");
+    panic!("{case }}");
+}
+
 fn main() {
     missing();
     ok_single();
@@ -48,4 +57,5 @@ fn main() {
     ok_bracket();
     ok_inner();
     ok_nomsg();
+    ok_escaped();
 }