-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Regression: Fail to evaluate self-referential static slices #120949
Comments
searched nightlies: from nightly-2024-02-10 to nightly-2024-02-11 bisected with cargo-bisect-rustc v0.6.8Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc -vv --start 2024-02-10 --without-cargo -vv --script rustc -- src/lib.rs |
Context for how I found this: I use this technique in Divan in code generation for benchmarks of generic functions. The simple example I gave is just a minimal reproduction of the issue. |
Hm, that is very strange. Not sure if there is a good way to get the backtrace of where in the code the cyclic queries are made? My first guess is that it is the new call to rust/compiler/rustc_const_eval/src/interpret/validity.rs Lines 464 to 472 in 77f8c3c
But... surely we can ask for the type of a static while evaluating that very static, that can't be cyclic? |
Ah no, probably it is related to the fact that we now recursively validate when a constant points to a static. Previously we stopped there. I guess we should not do that for promoteds. |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high -E-needs-bisection +T-compiler |
Code
I tried this code:
I expected to see this happen: compile fine, with the
VALUE
static containing a slice that referencesVALUE
.Instead, this happened:
Version it worked on
It most recently worked on:
nightly-2024-02-10
Version with regression
nightly-2024-02-11
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: