Skip to content

Commit

Permalink
rustc_safe_intrinsic: Add UI test
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Sep 28, 2022
1 parent 37bf8f8 commit b1b8649
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/test/ui/intrinsics/safe-intrinsic-mismatch.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 0 deletions src/test/ui/intrinsics/safe-intrinsic-mismatch.stderr
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b1b8649

Please sign in to comment.