mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
rustc_safe_intrinsic: Add UI test
This commit is contained in:
parent
37bf8f888c
commit
b1b86491f1
11
src/test/ui/intrinsics/safe-intrinsic-mismatch.rs
Normal file
11
src/test/ui/intrinsics/safe-intrinsic-mismatch.rs
Normal file
@ -0,0 +1,11 @@
|
||||
#![feature(intrinsics)]
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
extern "rust-intrinsic" {
|
||||
fn size_of<T>() -> usize; //~ ERROR intrinsic safety mismatch
|
||||
|
||||
#[rustc_safe_intrinsic]
|
||||
fn assume(b: bool); //~ ERROR intrinsic safety mismatch
|
||||
}
|
||||
|
||||
fn main() {}
|
14
src/test/ui/intrinsics/safe-intrinsic-mismatch.stderr
Normal file
14
src/test/ui/intrinsics/safe-intrinsic-mismatch.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `size_of`
|
||||
--> $DIR/safe-intrinsic-mismatch.rs:5:5
|
||||
|
|
||||
LL | fn size_of<T>() -> usize;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `assume`
|
||||
--> $DIR/safe-intrinsic-mismatch.rs:8:5
|
||||
|
|
||||
LL | fn assume(b: bool);
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
Loading…
Reference in New Issue
Block a user