]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/panic.rs
Create lint for unimplemented!()
[rust.git] / tests / ui / panic.rs
index 03d3c3dc2d947a2b4f2f1dcb36d31c01bb740c57..56d06f23904b52dc41719ca106eba8781205cf62 100644 (file)
@@ -1,7 +1,7 @@
-#![feature(plugin)]
-#![plugin(clippy)]
 
-#![warn(panic_params)]
+
+
+#![warn(panic_params, unimplemented)]
 
 fn missing() {
     if true {
@@ -11,6 +11,8 @@ fn missing() {
     } else {
         assert!(true, "here be missing values: {}");
     }
+
+    panic!("{{{this}}}");
 }
 
 fn ok_single() {
@@ -41,6 +43,20 @@ fn ok_nomsg() {
     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 unimplemented() {
+    unimplemented!();
+}
+
 fn main() {
     missing();
     ok_single();
@@ -48,4 +64,6 @@ fn main() {
     ok_bracket();
     ok_inner();
     ok_nomsg();
+    ok_escaped();
+    unimplemented();
 }