-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[early rough draft] GCI: Don't evaluate free const items with impossible predicates #142293
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
base: master
Are you sure you want to change the base?
Conversation
@bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
[early rough draft] GCI: Don't evaluate free const items with impossible predicates
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
This one might be dicey since we don't check requires_own_monomorization
. impossible_predicates
is likely wrong without it. Example by Boxy: <T> [T]: Sized
.
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.
We should consider moving all of these call-site checks into ctfe itself, e.g. eval_to_const_value_raw_provider
. This wont affect const patterns which go through _for_typeck
versions of the CTFE entry points.
I also then think that the impossible predicates check in that place should ICE on predicates containing non region params as that shouldn't be reachable (and if it is, then we're evaluating generic constants in places we might not want to be).
// for codegen. Everything else is only needed during const-eval, so even if | ||
// const-eval happens in a downstream crate, all they need is | ||
// `mir_for_ctfe`. | ||
match self.tcx.const_eval_poly_to_alloc(item.owner_id.def_id.into()) { |
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.
This being one such place where we evaluate generic stuff where we probably oughtn't
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (4151b9a): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary -5.1%, secondary -2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 753.145s -> 753.291s (0.02%) |
No description provided.