diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-22034.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-22034.rs b/src/test/ui/issues/issue-22034.rs new file mode 100644 index 000000000..405ffd089 --- /dev/null +++ b/src/test/ui/issues/issue-22034.rs @@ -0,0 +1,11 @@ +#![feature(rustc_private)] + +extern crate libc; + +fn main() { + let ptr: *mut () = core::ptr::null_mut(); + let _: &mut dyn Fn() = unsafe { + &mut *(ptr as *mut dyn Fn()) + //~^ ERROR expected a `Fn<()>` closure, found `()` + }; +} |