-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Various const eval and pattern matching ICE fixes #67192
Conversation
cc @varkor for the match code changes |
// FIXME(oli-obk): make this check an assertion that it's not a static here | ||
// FIXME(RalfJ, oli-obk): document that `Place::Static` can never be anything but a static | ||
// and `ConstValue::Unevaluated` can never be a static | ||
let param_env = if self.tcx.is_static(gid.instance.def_id()) { | ||
// FIXME(oli-obk, spastorino): the above FIXME is not true anymore, PlaceBase::Static does | ||
// not exist anymore (except for promoteds but it's going away soon). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This chain of FIXMEs is getting some weird kind of joke.^^
I think it referred to the "lazy" vs "evaluated" AllocId for statics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last two are gone in my PR 😄
I don't understand the motivation for this. This changes one of many allocation methods to avoid ZST, but we may still get empty allocations elsewhere. (At least, there's no assertion that I could see in |
I could set it up so ZST |
I tried to keep every change as independent of all the others as possible and make a commit for each step. Some of these could be pulled out into a separate PR without changing behaviour if you want. |
☔ The latest upstream changes (presumably #67284) made this pull request unmergeable. Please resolve the merge conflicts. |
d9aacf2
to
21ea367
Compare
This PR has now turned around 100% and is not changing behaviour wrt zst addresses anymore |
21ea367
to
b75a2a0
Compare
This comment has been minimized.
This comment has been minimized.
81fbca4
to
c86fe4a
Compare
This comment has been minimized.
This comment has been minimized.
I believe I have addressed all review comments |
fe01f9b
to
d2ad810
Compare
@bors try |
⌛ Trying commit d2ad810 with merge e45d134659ec3c8628d74e3ddb5c9f0d1df24223... |
ad964e7
to
f65a91e
Compare
rebased over rustfmt and const_eval.rs split PRs @bors r=RalfJung,varkor |
📌 Commit f65a91e has been approved by |
…varkor Various const eval and pattern matching ICE fixes r? @RalfJung cc @spastorino This PR does not change existing behaviour anymore and just fixes a bunch of ICEs reachable from user code (sometimes even on stable via obscure union transmutes).
Rollup of 12 pull requests Successful merges: - #67112 (Refactor expression parsing thoroughly) - #67192 (Various const eval and pattern matching ICE fixes) - #67287 (typeck: note other end-point when checking range pats) - #67459 (prune ill-conceived BTreeMap iter_mut assertion and test its mutability) - #67576 (reuse `capacity` variable in slice::repeat) - #67602 (Use issue = "none" instead of "0" in intrinsics) - #67614 (Set callbacks globally) - #67617 (Remove `compiler_builtins_lib` documentation) - #67629 (Remove redundant link texts) - #67632 (Convert collapsed to shortcut reference links) - #67633 (Update .mailmap) - #67635 (Document safety of Path casting) Failed merges: r? @ghost
Various const eval and pattern matching ICE fixes r? @RalfJung cc @spastorino This PR does not change existing behaviour anymore and just fixes a bunch of ICEs reachable from user code (sometimes even on stable via obscure union transmutes).
☀️ Test successful - checks-azure |
Tested on commit rust-lang/rust@8f5f8f9. Direct link to PR: <rust-lang/rust#67192> 💔 miri on windows: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung, @rust-lang/infra). 💔 miri on linux: test-pass → build-fail (cc @oli-obk @eddyb @RalfJung, @rust-lang/infra).
Remove all uses of `to_ptr` Also only works on top of rust-lang/rust#67192
r? @RalfJung
cc @spastorino
This PR does not change existing behaviour anymore and just fixes a bunch of ICEs reachable from user code (sometimes even on stable via obscure union transmutes).