Skip to content
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

Ensure that panicking in constants eventually errors #67164

Merged
merged 2 commits into from
Dec 11, 2019

Conversation

matthewjasper
Copy link
Contributor

based on #67134

closes #66975

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 8, 2019
@oli-obk
Copy link
Contributor

oli-obk commented Dec 9, 2019

Please also add the test from the issue as a ui test showing that we error if the value is actually used.

@oli-obk
Copy link
Contributor

oli-obk commented Dec 9, 2019

Also, does your change fix

#![feature(const_panic)]
#![allow(const_err)]

const VOID: ! = panic!();

fn main() {
    let _ = VOID;
}

Or will this still compile?

@oli-obk
Copy link
Contributor

oli-obk commented Dec 10, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Dec 10, 2019

📌 Commit d2ed209 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 10, 2019
Centril added a commit to Centril/rust that referenced this pull request Dec 11, 2019
…=oli-obk

Ensure that panicking in constants eventually errors

based on rust-lang#67134

closes rust-lang#66975

r? @oli-obk
bors added a commit that referenced this pull request Dec 11, 2019
Rollup of 6 pull requests

Successful merges:

 - #66881 (Optimize Ord trait implementation for bool)
 - #67015 (Fix constant propagation for scalar pairs)
 - #67074 (Add options to --extern flag.)
 - #67164 (Ensure that panicking in constants eventually errors)
 - #67174 (Remove `checked_add` in `Layout::repeat`)
 - #67205 (Make `publish_toolstate.sh` executable)

Failed merges:

r? @ghost
@bors bors merged commit d2ed209 into rust-lang:master Dec 11, 2019
@matthewjasper matthewjasper deleted the never-remove-const branch December 15, 2019 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Program that uses the const VOID: ! =panic!() associated constant compiles and runs into illegal intruction.
4 participants