Skip to content

Commit b1b8649

Browse files
committed
rustc_safe_intrinsic: Add UI test
1 parent 37bf8f8 commit b1b8649

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![feature(intrinsics)]
2+
#![feature(rustc_attrs)]
3+
4+
extern "rust-intrinsic" {
5+
fn size_of<T>() -> usize; //~ ERROR intrinsic safety mismatch
6+
7+
#[rustc_safe_intrinsic]
8+
fn assume(b: bool); //~ ERROR intrinsic safety mismatch
9+
}
10+
11+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `size_of`
2+
--> $DIR/safe-intrinsic-mismatch.rs:5:5
3+
|
4+
LL | fn size_of<T>() -> usize;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `assume`
8+
--> $DIR/safe-intrinsic-mismatch.rs:8:5
9+
|
10+
LL | fn assume(b: bool);
11+
| ^^^^^^^^^^^^^^^^^^
12+
13+
error: aborting due to 2 previous errors
14+

0 commit comments

Comments
 (0)