-
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
do not normalize all non-scalar constants to a ConstValue::ScalarPair #54693
Conversation
Cc @oli-obk |
@bors r+ |
📌 Commit d62aa3e has been approved by |
A less risky variant for beta might be to just backport the changes in |
do not normalize all non-scalar constants to a ConstValue::ScalarPair We still need `ConstValue::ScalarPair` for match handling (matching slices and strings), but that will never see anything `Undef`. For non-fat-ptr `ScalarPair`, just point to the allocation like larger data structures do. Fixes #54387 r? @eddyb
☀️ Test successful - status-appveyor, status-travis |
📣 Toolstate changed by #54693! Tested on commit 7cbcdae. 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). |
Tested on commit rust-lang/rust@7cbcdae. Direct link to PR: <rust-lang/rust#54693> 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). 💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). 💔 miri on windows: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra). 💔 miri on linux: test-pass → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra). 💔 rls on windows: test-pass → build-fail (cc @nrc, @rust-lang/infra). 💔 rls on linux: test-pass → build-fail (cc @nrc, @rust-lang/infra).
So the argument here is that anything that doesn't need an allocation should be fully initialized? |
Yes. We have those variants only because pattern matching and some code around array lengths need them. No reason they should have to handle Everything gets an allocation anyway from the way |
Also see #54738 |
I made a beta backport at #54759 |
Oh dang. Now I see @oli-obk already did that. oops^^ |
T-compiler accepted #54759 for the backport. |
We still need
ConstValue::ScalarPair
for match handling (matching slices and strings), but that will never see anythingUndef
. For non-fat-ptrScalarPair
, just point to the allocation like larger data structures do.Fixes #54387
r? @eddyb