-
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
Always evaluate free constants and statics, even if previous errors occurred #121087
Conversation
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The Miri subtree was changed cc @rust-lang/miri |
2cdd83a
to
17adcb3
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me after nits + CI
static BOO: &mut Foo<()> = &mut Foo(()); | ||
//~^ ERROR encountered mutable pointer in final value of static | ||
|
||
// interior mutability is fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outdated comment, this test generally feels somewhat useless rn, given that its behavior doesn't depend on -Zunleash-the-miri-inside-of-you
afaict?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stderr has a bunch of "skipping check that does not even have a feature gate", so I think it does depend on the unleash flag.
0bb9b2b
to
3f88472
Compare
This comment has been minimized.
This comment has been minimized.
3f88472
to
e8e0f86
Compare
let secondary_errors = mem::take(&mut self.secondary_errors); | ||
if self.error_emitted.is_none() { | ||
for error in secondary_errors { | ||
error.emit(); | ||
self.error_emitted = Some(error.emit()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RalfJung found the issue that caused us to const eval even though there were const qualif errors 🙈
☔ The latest upstream changes (presumably #116564) made this pull request unmergeable. Please resolve the merge conflicts. |
e8e0f86
to
39d167c
Compare
This comment has been minimized.
This comment has been minimized.
Wouldn't it be possible to represent the id of nested statics as a pair of "def id of containing static" and "index of this nested static"? |
39d167c
to
7770df0
Compare
yes, but that just makes everything more complex, as then everything needs to handle this special case. I tried it, and it's annoying to get right. Just generating a new static per nested allocation was significantly simpler. |
@bors r=lcnr |
Finished benchmarking commit (cce6a6e): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 641.541s -> 639.567s (-0.31%) |
Looking into the regressions. They are unintended |
…ion, r=<try> Avoid some unnecessary query invocations. Specifically this inlines `const_eval_poly` and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything. should fix the perf regression from rust-lang#121087
…ion, r=<try> Avoid some unnecessary query invocations. Specifically this inlines `const_eval_poly` and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything. should fix the perf regression from rust-lang#121087
…ion, r=<try> Avoid some unnecessary query invocations. Specifically this inlines `const_eval_poly` and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything. should fix the perf regression from rust-lang#121087
Always evaluate free constants and statics, even if previous errors occurred work towards rust-lang#79738 We will need to evaluate static items before the `definitions.freeze()` below, as we will start creating new `DefId`s (for nested allocations) within the `eval_static_initializer` query. But even without that motivation, this is a good change. Hard errors should always be reported and not silenced if other errors happened earlier.
…ion, r=lcnr Avoid some unnecessary query invocations. Specifically this inlines `const_eval_poly` and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything. should fix the perf regression from rust-lang#121087
Avoid some unnecessary query invocations. Specifically this inlines `const_eval_poly` and avoids computing the generic params, the param env, normalizing the param env and erasing lifetimes on everything. should fix the perf regression from rust-lang/rust#121087
work towards #79738
We will need to evaluate static items before the
definitions.freeze()
below, as we will start creating newDefId
s (for nested allocations) within theeval_static_initializer
query.But even without that motivation, this is a good change. Hard errors should always be reported and not silenced if other errors happened earlier.