Skip to content

Commit

Permalink
add testcase for 34123
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Nov 8, 2020
1 parent 771cc7f commit 1f11373
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/ui/intrinsic_ice.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Test for https://github.com/rust-lang/rust/issues/34123
// ICE: intrinsic .. being reified

#![feature(intrinsics)]

fn main(){
let transmute = std::intrinsics::transmute;
let assign: unsafe extern "rust-intrinsic" fn(*const i32) -> *mut i32 = transmute;
}
18 changes: 18 additions & 0 deletions src/test/ui/intrinsic_ice.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
error[E0308]: cannot coerce intrinsics to function pointers
--> intrinsic_ice.rs:8:77
|
L | let assign: unsafe extern "rust-intrinsic" fn(*const i32) -> *mut i32 = transmute;
| --------------------------------------------------------- ^^^^^^^^^ cannot coerce intrinsics to function pointers
| |
| expected due to this
|
= note: expected fn pointer `unsafe extern "rust-intrinsic" fn(*const i32) -> *mut i32`
found fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
help: use parentheses to call this function
|
L | let assign: unsafe extern "rust-intrinsic" fn(*const i32) -> *mut i32 = transmute(...);
| ^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.

0 comments on commit 1f11373

Please sign in to comment.