diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 1b17faccc87..8181dba1e96 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -4666,6 +4666,7 @@ 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. @@ -4726,6 +4727,26 @@ let x = &[1_usize, 2] as &[usize]; // ok! ``` "##, +E0621: r##" +An intrinsic was declared without being a function. + +Erroneous code example: + +```compile_fail,E0621 +#![feature(intrinsics)] +extern "rust-intrinsic" { + pub static breakpoint : unsafe extern "rust-intrinsic" fn(); + // error: intrinsic must be a function +} + +fn main() { unsafe { breakpoint(); } } +``` + +An intrinsic is a function available for use in a given programming language +whose implementation is handled specially by the compiler. In order to fix this +error, just declare a function. +"##, + } register_diagnostics! { diff --git a/src/test/compile-fail/E0619.rs b/src/test/compile-fail/E0619.rs index 8ef90d89931..7c61a61f0bd 100644 --- a/src/test/compile-fail/E0619.rs +++ b/src/test/compile-fail/E0619.rs @@ -1,4 +1,4 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// 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. // @@ -8,11 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn main() { - let x; - - match x { - (..) => {} //~ ERROR E0619 - _ => {} - } +#![feature(intrinsics)] +extern "rust-intrinsic" { + pub static breakpoint : unsafe extern "rust-intrinsic" fn(); + //~^ ERROR intrinsic must be a function [E0619] } +fn main() { unsafe { breakpoint(); } } diff --git a/src/test/compile-fail/invalid-intrinsic.rs b/src/test/compile-fail/invalid-intrinsic.rs deleted file mode 100644 index c42d78c323e..00000000000 --- a/src/test/compile-fail/invalid-intrinsic.rs +++ /dev/null @@ -1,16 +0,0 @@ -// 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 or the MIT license -// , 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 -} -fn main() { unsafe { breakpoint(); } }