-
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
Internal compiler error: task failed at 'Unsupported constant expr' #5448
Comments
"@0" means "allocate a box on the managed heap and write 0 into it", so you can't do that statically; the heap doesn't exist statically. I'm not sure if that's clear or not, but I could maybe say more if I knew more about what you're trying to do... |
I'm fairly confused about pointers in Rust generally, but putting I'm trying to write a Bitmapped Vector Trie. This means having a bunch of size 32 arrays of pointers. I wanted to be able to express that the array will always be size 32, so I used the I wanted it make it a more functional style data structure (with immutability/structure sharing), but that seemed to be making my pointer-lifetime compiler errors worse, so I'm currently (well, attempting) to use a |
I think you want |
@jdm Thanks! That fixed it. :) |
…, r=phansch Update documentation for new_ret_no_self changelog: Update documentation for lint new_ret_no_self to reflect that the return type must only contain `Self`, not be `Self` The lint was changed to be more lenient than the documentation implies in PR rust-lang#3338 (Related issue rust-lang#3313)
The code and the compiler backtrace output is in this gist.
The relevant parts of the compiler output seem to be:
and maybe:
The part of my code that I think causes it is this:
Specifically,
[@0,..@31]
seems to be the change that triggered this bug.I'm trying to find a way to create a static mutable array of managed pointers to ints, of size 32. Needing this might very well be a side-effect of my not knowing how to design/implement data structures in rust, but it's what I need to make the types work out at this point (to actually instantiate a
Level1
), I think.The output of
rustc --version
is:The text was updated successfully, but these errors were encountered: