rust/tests/ui/unsafe/unsafe-unstable-const-fn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
369 B
Rust
Raw Normal View History

// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
2020-05-20 21:55:38 +00:00
#![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
2020-05-20 21:55:38 +00:00
}
fn main() {}