Skip to content

Commit 09619bc

Browse files
Add regression test for #72394
1 parent 119efbc commit 09619bc

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![stable(feature = "foo", since = "1.33.0")]
2+
#![feature(staged_api)]
3+
#![feature(const_compare_raw_pointers)]
4+
#![feature(const_fn)]
5+
6+
#[stable(feature = "foo", since = "1.33.0")]
7+
#[rustc_const_unstable(feature = "const_foo", issue = "none")]
8+
const fn unstable(a: *const i32, b: *const i32) -> bool {
9+
a == b
10+
//~^ pointer operation is unsafe
11+
}
12+
13+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0133]: pointer operation is unsafe and requires unsafe function or block
2+
--> $DIR/unsafe-unstable-const-fn.rs:9:5
3+
|
4+
LL | a == b
5+
| ^^^^^^ pointer operation
6+
|
7+
= note: operations on pointers in constants
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0133`.

0 commit comments

Comments
 (0)