]> git.proxmox.com Git - rustc.git/blobdiff - src/test/compile-fail/issue-6804.rs
New upstream version 1.14.0+dfsg1
[rustc.git] / src / test / compile-fail / issue-6804.rs
index f6b7e13c4f5e9328593e8bab6c99e8b233d8ffac..f7d3ce60c66ccf3573ccfc73323c325decfb8fa6 100644 (file)
@@ -8,29 +8,24 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(rustc_attrs)]
-#![feature(slice_patterns)]
-#![allow(dead_code)]
-
 // Matching against NaN should result in a warning
 
+#![feature(slice_patterns)]
+#![allow(unused)]
+
 use std::f64::NAN;
 
-#[rustc_error]
-fn main() { //~ ERROR compilation successful
+fn main() {
     let x = NAN;
     match x {
-        NAN => {},
+        NAN => {}, //~ ERROR floating point constants cannot be used
+                   //~| WARNING hard error
         _ => {},
     };
-    //~^^^ WARNING unmatchable NaN in pattern, use the is_nan method in a guard instead
-    //~| WARNING floating point constants cannot be used
-    //~| WARNING this was previously accepted
+
     match [x, 1.0] {
-        [NAN, _] => {},
+        [NAN, _] => {}, //~ ERROR floating point constants cannot be used
+                        //~| WARNING hard error
         _ => {},
     };
-    //~^^^ WARNING unmatchable NaN in pattern, use the is_nan method in a guard instead
-    //~| WARNING floating point constants cannot be used
-    //~| WARNING this was previously accepted
 }