rustc_safe_intrinsic: Add UI test

This commit is contained in:
Arthur Cohen 2022-09-27 07:22:07 +02:00
parent 37bf8f888c
commit b1b86491f1
2 changed files with 25 additions and 0 deletions

View 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() {}

View 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