diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/unsafe/unsafe-unstable-const-fn.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/unsafe/unsafe-unstable-const-fn.rs b/src/test/ui/unsafe/unsafe-unstable-const-fn.rs new file mode 100644 index 000000000..581b15cdf --- /dev/null +++ b/src/test/ui/unsafe/unsafe-unstable-const-fn.rs @@ -0,0 +1,14 @@ +// revisions: mir thir +// [thir]compile-flags: -Z thir-unsafeck + +#![stable(feature = "foo", since = "1.33.0")] +#![feature(staged_api)] + +#[stable(feature = "foo", since = "1.33.0")] +#[rustc_const_unstable(feature = "const_foo", issue = "none")] +const fn unstable(a: *const i32, b: i32) -> bool { + *a == b + //~^ dereference of raw pointer is unsafe +} + +fn main() {} |