Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ensure failing promoteds in const/static bodies are handled correctly #85112

Merged
merged 2 commits into from
May 10, 2021

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented May 9, 2021

const/static bodies are the one case where we still promote code that might fail to evaluate. Ensure that this is handled correctly; in particular, it must not fail compilation.

src/test/ui/consts/const-eval/erroneous-const.rs ensures that when a non-promoted fails to evaluate, we do show an error.

r? @oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented May 10, 2021

@bors r+

@bors
Copy link
Contributor

bors commented May 10, 2021

📌 Commit 7a01160 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 May 10, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2021
Rollup of 6 pull requests

Successful merges:

 - rust-lang#85050 (Fix suggestions for missing return type lifetime specifiers)
 - rust-lang#85075 (Improve "panic message is not a string literal" warning)
 - rust-lang#85096 (Make unchecked_{add,sub,mul} inherent methods unstably const)
 - rust-lang#85112 (ensure failing promoteds in const/static bodies are handled correctly)
 - rust-lang#85146 (Provide io::Seek::rewind)
 - rust-lang#85147 (:arrow_up: rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ae8a438 into rust-lang:master May 10, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 10, 2021
@RalfJung RalfJung deleted the promoted-errors branch May 11, 2021 17:48
@RalfJung
Copy link
Member Author

Lol, I just realized I had already added a similar test in #80579... but this one is slightly different, so this seems good to get more coverage. :)

# for free to join this conversation on GitHub. Already have an account? # 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.

5 participants