-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
const_generics: correctly deal with bound variables #98900
Conversation
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 70f11da4fe0c07822290824ae21fa266d9e19f5e with merge 05fe25a300b6473d232e4b32b3f240dbba9f3c3f... |
| ty::Placeholder(_) | ||
| ty::Infer(_) => throw_inval!(TooGeneric), | ||
ty::Bound(_, _) => bug!("bound ty during ctfe"), |
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.
Curious to have this ICE only for variant_count
?
Though this might be the only exhaustive type match in the interpreter 🤷 it just won't give a lot of coverage.
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.
^^ yeah, I also thought that we would have this in more places. ctfe mostly doesn't care about ty::Const
. Stuff like type name looks into types, so there bound stuff is allowed, e.g. for for<'a> fn(&'a ())
'a
should be bound.
The only other place I found was const_to_op
which I've also changed
☀️ Try build successful - checks-actions |
Queued 05fe25a300b6473d232e4b32b3f240dbba9f3c3f with parent d2074cb, future comparison URL. |
Finished benchmarking commit (05fe25a300b6473d232e4b32b3f240dbba9f3c3f): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Footnotes |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 0632724d09aedd7b2942590ff73b6c0c2b7b4465 with merge 8fdfdbe7af0ae6247b009133b3477c4d4c75ab42... |
@bors try @rust-timer queue |
@bors clean |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 2d7a649be740f9819be48b87cbbed9842b6f4ec4 with merge 3553e445517920c619c2dae2a58199d8276c96ea... |
☀️ Try build successful - checks-actions |
Queued 3553e445517920c619c2dae2a58199d8276c96ea with parent 54f79ba, future comparison URL. |
Finished benchmarking commit (3553e445517920c619c2dae2a58199d8276c96ea): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Footnotes |
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.
Comment needed then r=me
@@ -637,6 +642,29 @@ pub struct BoundVarReplacer<'me, 'tcx> { | |||
universe_indices: &'me mut Vec<Option<ty::UniverseIndex>>, | |||
} | |||
|
|||
pub fn with_replaced_escaping_bound_vars<'a, 'tcx, T: TypeFoldable<'tcx>, R: TypeFoldable<'tcx>>( |
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.
Can you add a comment and maybe a FIXME that we should be more careful to not leak placeholders?
@bors r=jackh726 rollup=never |
📌 Commit 5824746aa28d906f2072d7b9c2acd4aca373be5b has been approved by It is now in the queue for this repository. |
@bors r=jackh726 rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ccb5595): comparison URL. Overall result: ✅ improvements - no action needed@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.
Footnotes |
remove bound var hack in `resolve` somehow dropped that change from rust-lang#98900. r? `@jackh726`
This PR is being blamed for a regression in #103243 . |
removes the hack in
resolve
which was needed because we evaluated constants without caring about their bound variables.Each commit should be fairly self-contained, even if they build on each other
r? @jackh726