-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
GCI: At their def site, actually wfcheck the where-clause & always eval free lifetime-generic constants #136429
base: master
Are you sure you want to change the base?
Conversation
let typing_env = ty::TypingEnv::fully_monomorphized(); | ||
tcx.ensure().eval_to_const_value_raw(typing_env.as_query_input(cid)); | ||
DefKind::Const if !tcx.generics_of(item_def_id).requires_monomorphization(tcx) => { | ||
tcx.ensure().const_eval_poly(item_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 temporarily 'reverts' the perf optimization from #121387. I have to see what to do about this.
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.
IINM const_eval_poly
would be the 'most correct' option since we do want to construct the Instance
with identity substs (contrary to empty ones) and likely do want use the ParamEnv of the free constant lol (tho I've yet to find an example where the latter makes a difference it practice)
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
GCI: At their def site, actually wfcheck the where-clause & always eval free lifetime-generic constants 1st commit: Partially addresses rust-lang#136204 by turning const eval errors from post to pre-mono for free lifetime-generic constants. Re. 2nd commit: Oof, that's embarrassing! How could I miss that in the initial impl? This doesn't fully address rust-lang#136204 because I still haven't figured out how & where to properly & best suppress const eval of free constants whose predicates don't hold at the def site. The motivating example is `#![feature(trivial_bounds)] const _UNUSED: () = () where String: Copy;` which can also be found over at the tracking issue rust-lang#113521. r? compiler-errors or reassign
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (ea1cdda): comparison URL. Overall result: ❌ regressions - please read the text belowBenchmarking 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 Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 1.5%, secondary -2.0%)This 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.
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: 777.275s -> 776.801s (-0.06%) |
5a8ee9b
to
1dc3d6e
Compare
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri, @rust-lang/wg-const-eval |
1dc3d6e
to
9c2b71a
Compare
Co-authored-by: Michael Goulet <michael@errs.io>
Probably won't make a difference because erase_regions no-ops on region-erased things anyway.
9c2b71a
to
9f2fdff
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
GCI: At their def site, actually wfcheck the where-clause & always eval free lifetime-generic constants 1st commit: Partially addresses rust-lang#136204 by turning const eval errors from post to pre-mono for free lifetime-generic constants. Re. 2nd commit: Oof, yeah, I missed that in the initial impl! This doesn't fully address rust-lang#136204 because I still haven't figured out how & where to properly & best suppress const eval of free constants whose predicates don't hold at the def site. The motivating example is `#![feature(trivial_bounds)] const _UNUSED: () = () where String: Copy;` which can also be found over at the tracking issue rust-lang#113521. r? compiler-errors or reassign
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
turning const eval errors from post to pre-mono for free lifetime-generic constants.
This should be listed as an item in the tracking issue to make sure it is discussed during stabilization.
|
I'll go you one better and mention it in the upcoming RFC. |
Finished benchmarking commit (6f11489): comparison URL. Overall result: ❌ regressions - please read the text belowBenchmarking 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 Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.3%)This 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.
CyclesResults (primary 2.0%)This 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: 778.369s -> 778.266s (-0.01%) |
1st commit: Partially addresses #136204 by turning const eval errors from post to pre-mono for free lifetime-generic constants.
Re. 2nd commit: Oof, yeah, I missed that in the initial impl!
This doesn't fully address #136204 because I still haven't figured out how & where to properly & best suppress const eval of free constants whose predicates don't hold at the def site. The motivating example is
#![feature(trivial_bounds)] const _UNUSED: () = () where String: Copy;
which can also be found over at the tracking issue #113521.r? compiler-errors or reassign