]> git.lizzy.rs Git - rust.git/commitdiff
Fix error codes mixup
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 29 Jun 2017 19:03:19 +0000 (21:03 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 30 Jun 2017 20:43:35 +0000 (22:43 +0200)
src/librustc_typeck/check/intrinsic.rs
src/librustc_typeck/diagnostics.rs
src/test/compile-fail/E0619.rs
src/test/compile-fail/E0622.rs [new file with mode: 0644]

index 3acfbd1d844038183f92c32ea1b24433e353ed4d..96643ae72abadc5c7beaade2ff465137743c0a17 100644 (file)
@@ -37,7 +37,7 @@ fn equate_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     match it.node {
         hir::ForeignItemFn(..) => {}
         _ => {
-            struct_span_err!(tcx.sess, it.span, E0619,
+            struct_span_err!(tcx.sess, it.span, E0622,
                              "intrinsic must be a function")
                 .span_label(it.span, "expected a function")
                 .emit();
index 8181dba1e960d52d85ff910e9218140b2579ed95..37f6f3753d7b4fea373fba03fb68c68b3323b797 100644 (file)
@@ -4666,7 +4666,6 @@ fn i_am_a_function() {}
 "##,
 
 E0619: r##"
-<<<<<<< HEAD
 The type-checker needed to know the type of an expression, but that type had not
 yet been inferred.
 
@@ -4727,12 +4726,12 @@ fn i_am_a_function() {}
 ```
 "##,
 
-E0621: r##"
+E0622: r##"
 An intrinsic was declared without being a function.
 
 Erroneous code example:
 
-```compile_fail,E0621
+```compile_fail,E0622
 #![feature(intrinsics)]
 extern "rust-intrinsic" {
     pub static breakpoint : unsafe extern "rust-intrinsic" fn();
index 7c61a61f0bd8a4c5f84579a5680e4d7b3b7f3885..a5a5ff7218dcfe26150499924ba76594dfe2fded 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -8,9 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(intrinsics)]
-extern "rust-intrinsic" {
-    pub static breakpoint : unsafe extern "rust-intrinsic" fn();
-    //~^ ERROR intrinsic must be a function [E0619]
+fn main() {
+    let x;
+
+    match x {
+        (..) => {} //~ ERROR E0619
+        _ => {}
+    }
 }
-fn main() { unsafe { breakpoint(); } }
+
diff --git a/src/test/compile-fail/E0622.rs b/src/test/compile-fail/E0622.rs
new file mode 100644 (file)
index 0000000..f2bde5b
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(intrinsics)]
+extern "rust-intrinsic" {
+    pub static breakpoint : unsafe extern "rust-intrinsic" fn();
+    //~^ ERROR intrinsic must be a function [E0622]
+}
+fn main() { unsafe { breakpoint(); } }