You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New compiler error in beta: this constant cannot be used, attempted to read undefined bytes #54387
cc @RalfJung@oli-obk I can't find anything in the validation code that's reading the wrong thing - it should be able to tell this is a None, which has 0 fields.
I've been looking into this. It seems that the issue stems from here. Specifically, because the niche-filling enum representation is used for Option<GstRc> and similar types, and the niche that gets filled is the second field (the bool), it is actually the second part of the ScalarPair that is defined, not the first.
Actually it looks like this is not a ScalarPair, but a Scalar being undef. At least that's what the line numbers are saying. It does not make much sense though.
EDIT: It is definitely a ScalarPair, just the line numbers seem to be wrong.
Activity
csmoe commentedon Sep 20, 2018
the testcase compiles with
stable-1.29.0.hanna-kruppe commentedon Sep 21, 2018
Minimized:
pnkfelix commentedon Sep 27, 2018
Visited during T-compiler meeting. Tentatively assigning to @eddyb for investigation.
eddyb commentedon Sep 27, 2018
cc @RalfJung @oli-obk I can't find anything in the validation code that's reading the wrong thing - it should be able to tell this is a
None, which has0fields.AstralSorceress commentedon Sep 27, 2018
I've been looking into this. It seems that the issue stems from here. Specifically, because the niche-filling enum representation is used for
Option<GstRc>and similar types, and the niche that gets filled is the second field (thebool), it is actually the second part of theScalarPairthat is defined, not the first.eddyb commentedon Sep 28, 2018
Ahh, you're right! I don't know why only the second component was special-cased.
RalfJung commentedon Sep 29, 2018
Seems like @oli-obk's quest to keep
Undefcontained within the CTFE engine failed at last. :/However, in this case nothing should even be trying to convert to a
ConstValue. So I am not sure if that's really the problem.RalfJung commentedon Sep 29, 2018
Actually it looks like this is not a
ScalarPair, but aScalarbeing undef. At least that's what the line numbers are saying. It does not make much sense though.EDIT: It is definitely a
ScalarPair, just the line numbers seem to be wrong.RalfJung commentedon Sep 30, 2018
I am working on a fix.
EDIT: Submitted as #54693
Auto merge of #54693 - RalfJung:ctfe-scalar-pair-undef, r=oli-obk
eddyb commentedon Oct 2, 2018
Should this be closed before we get a beta backport?
emilyalbini commentedon Oct 9, 2018
Backported to beta. Closing this.