Skip to content

Fix array indexing in consts (broken by earlier const enum fixes)#4844

Merged
bors merged 2 commits intorust-lang:incomingfrom
jld:const-index-fix
Feb 8, 2013
Merged

Fix array indexing in consts (broken by earlier const enum fixes)#4844
bors merged 2 commits intorust-lang:incomingfrom
jld:const-index-fix

Conversation

@jld
Copy link
Contributor

@jld jld commented Feb 8, 2013

Fixes #3169 and uses that to fix const array indexing, which I broke (in a way that doesn't break tests but will greatly confuse users) while trying to fix const enum vectors.

jld added 2 commits February 8, 2013 01:52
The number of operands of the LLVM node initializing the array
underlying a const vector isn't always the array length -- if the
array is of a sufficiently primitive type and all the elements' values
are known (or something like that), LLVM uses a specialized Constant
subclass that stores the data packed, and thus has no operands.  Oops.

But, because llsize_of now gives us a ConstantInt, we can just fix
rust-lang#3169 and this all goes away.
bors added a commit that referenced this pull request Feb 8, 2013
Fixes #3169 and uses that to fix const array indexing, which I broke (in a way that doesn't break tests but will greatly confuse users) while trying to fix const enum vectors.
@bors bors closed this Feb 8, 2013
@bors bors merged commit 9318bab into rust-lang:incoming Feb 8, 2013
RalfJung added a commit to RalfJung/rust that referenced this pull request Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments