-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Be more conservative about discarding caller_bound in ParamEnv::and
#84472
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 45e1f5e84760d00b9c7fd85bb2e06ec785240825 with merge 9885efde5b04a2021784d1ddfafa8ece66398251... |
☀️ Try build successful - checks-actions |
Queued 9885efde5b04a2021784d1ddfafa8ece66398251 with parent cb81dc5, future comparison URL. |
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 does seem right to me, is there a specific reason you've made this change? So are there some tests that break without this change?
compiler/rustc_middle/src/ty/mod.rs
Outdated
@@ -1207,7 +1207,7 @@ impl<'tcx> ParamEnv<'tcx> { | |||
Reveal::UserFacing => ParamEnvAnd { param_env: self, value }, | |||
|
|||
Reveal::All => { | |||
if value.is_global() { | |||
if value.is_global() && !value.has_ty_fresh() { |
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.
hmm, i would assume that has_ty_fresh
should instead be a subset of is_global
. i.e. i would add HAS_TY_FRESH
and HAS_CT_FRESH
to HAS_FREE_LOCAL_NAMES
🤔
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.
After some further thought, I think you're correct. I originally decided against doing that because I was worried about affecting unrelated calls of is_global()
. However, it should always be correct to return false
from is_global
, since is_global() == true
is used for caching and bypassing checks.
Finished benchmarking try commit (9885efde5b04a2021784d1ddfafa8ece66398251): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
I meant to mark this as WIP - it's a fix for #84399, but it still needs some cleanup and comments. I opened it for a perf run |
ParamEnv::and
ParamEnv::and
This ensures that `ParamEnv::and` preserves the original `caller_bounds` when we have a value containing fresh tys/consts. This ensures that when we cache a `SelectionCandidate`, the cache key (a `ParamEnvAnd`) contains all of the information that influenced the computation of our result (e.g. we may end up choosing a `ParamCandidate`)
45e1f5e
to
91daf70
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 91daf70 with merge d6198ca66b6828db3167ab78e7298795c0140b93... |
☀️ Try build successful - checks-actions |
Queued d6198ca66b6828db3167ab78e7298795c0140b93 with parent 6e2a344, future comparison URL. |
ParamEnv::and
ParamEnv::and
Finished benchmarking try commit (d6198ca66b6828db3167ab78e7298795c0140b93): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
⌛ Testing commit 091b7dd with merge e80ce7a23452e0a0be82cf218b4c64ca6003870e... |
💔 Test failed - checks-actions |
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
@bors retry |
⌛ Testing commit 091b7dd with merge dc0040a97af0adecdff4fd1b44e717be81110a11... |
💔 Test failed - checks-actions |
@bors retry |
⌛ Testing commit 091b7dd with merge b5588c22d430f067d0db3d8cdad961e8341da960... |
@bors retry - yield to stable |
@bors treeclosed- |
☀️ Test successful - checks-actions |
No description provided.