Skip to content

Commit 2c86ff4

Browse files
Fix error codes mixup
1 parent 76d54c0 commit 2c86ff4

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

src/librustc_typeck/check/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn equate_intrinsic_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
3737
match it.node {
3838
hir::ForeignItemFn(..) => {}
3939
_ => {
40-
struct_span_err!(tcx.sess, it.span, E0619,
40+
struct_span_err!(tcx.sess, it.span, E0621,
4141
"intrinsic must be a function")
4242
.span_label(it.span, "expected a function")
4343
.emit();

src/librustc_typeck/diagnostics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4666,7 +4666,6 @@ i_am_a_function();
46664666
"##,
46674667

46684668
E0619: r##"
4669-
<<<<<<< HEAD
46704669
The type-checker needed to know the type of an expression, but that type had not
46714670
yet been inferred.
46724671

src/test/compile-fail/E0619.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,9 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(intrinsics)]
12-
extern "rust-intrinsic" {
13-
pub static breakpoint : unsafe extern "rust-intrinsic" fn();
14-
//~^ ERROR intrinsic must be a function [E0619]
11+
fn main() {
12+
let x;
13+
14+
match x {
15+
(..) => {} //~ ERROR E0619
16+
_ => {}
17+
}
1518
}
16-
fn main() { unsafe { breakpoint(); } }
19+

src/test/compile-fail/E0621.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(intrinsics)]
12+
extern "rust-intrinsic" {
13+
pub static breakpoint : unsafe extern "rust-intrinsic" fn();
14+
//~^ ERROR intrinsic must be a function [E0621]
15+
}
16+
fn main() { unsafe { breakpoint(); } }

0 commit comments

Comments
 (0)