-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
119efbc
commit 09619bc
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#![stable(feature = "foo", since = "1.33.0")] | ||
#![feature(staged_api)] | ||
#![feature(const_compare_raw_pointers)] | ||
#![feature(const_fn)] | ||
|
||
#[stable(feature = "foo", since = "1.33.0")] | ||
#[rustc_const_unstable(feature = "const_foo", issue = "none")] | ||
const fn unstable(a: *const i32, b: *const i32) -> bool { | ||
a == b | ||
//~^ pointer operation is unsafe | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0133]: pointer operation is unsafe and requires unsafe function or block | ||
--> $DIR/unsafe-unstable-const-fn.rs:9:5 | ||
| | ||
LL | a == b | ||
| ^^^^^^ pointer operation | ||
| | ||
= note: operations on pointers in constants | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0133`. |