-
Notifications
You must be signed in to change notification settings - Fork 13.4k
add error_occured field to ConstQualifs, #78809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
fn main() { | ||
[(); { &loop { break } as *const _ as usize } ]; | ||
//~^ ERROR casting pointers to integers in constants is unstable | ||
//~| ERROR evaluation of constant value failed | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
struct Bug([u8; panic!(1)]); //~ ERROR panicking in constants is unstable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what a good test case is, in this case. So I added the one from the issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good test case. This PR does not yet fix |
||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error[E0658]: panicking in constants is unstable | ||
--> $DIR/issue-76064.rs:1:17 | ||
| | ||
LL | struct Bug([u8; panic!(1)]); | ||
| ^^^^^^^^^ | ||
| | ||
= note: see issue #51999 <https://github.com/rust-lang/rust/issues/51999> for more information | ||
= help: add `#![feature(const_panic)]` to the crate attributes to enable | ||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
fn main() { | ||
let _ = [0; (&0 as *const i32) as usize]; //~ ERROR casting pointers to integers in constants | ||
//~^ ERROR evaluation of constant value failed | ||
} |
Uh oh!
There was an error while loading. Please reload this page.