-
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
lint incorrect implied bounds in wfcheck #109763
Conversation
dcdb22e
to
fb49efa
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit fb49efa4c195a669c1d518c33e78b3adf9eea34b with merge 67ce1e9f41cb4c34e12f6d249826cce3f073c6c7... |
💔 Test failed - checks-actions |
fb49efa
to
3646834
Compare
This comment has been minimized.
This comment has been minimized.
@bors try |
⌛ Trying commit 364683472a016eb083e00c781635025f54044e49 with merge 9df496919a3bfe6478f619535af0fa752b6d84b5... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (9df496919a3bfe6478f619535af0fa752b6d84b5): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking 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 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.
|
3646834
to
91c7cd2
Compare
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
91c7cd2
to
13e0f74
Compare
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (7ff4f56db6ea2b678c8cccb37dd6b260df25763c): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking 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 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: 653.481s -> 654.306s (0.13%) |
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.
Sorry for the long review latency here.
Just a few smaller thoughts, before digging into the logic.
} | ||
}) | ||
.collect() | ||
) -> impl Iterator<Item = OutlivesBound<'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 we move this cleanup into a separate commit or PR?
param_env: ty::ParamEnv<'tcx>, | ||
arg: GenericArg<'tcx>, | ||
) -> Option<Vec<traits::PredicateObligation<'tcx>>> { | ||
) -> Vec<traits::PredicateObligation<'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.
This too can be moved into a separate commit or PR?
@@ -1828,7 +1828,7 @@ rustc_queries! { | |||
desc { "normalizing `{}`", goal.value } | |||
} | |||
|
|||
query implied_outlives_bounds( | |||
query implied_outlives_bounds_compat( |
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.
Given that it seems like most places still use this, it seems like it would make sense to keep this name the same, and name the new version v2 or something.
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.
Finally got through this, changes look good to me. I'm expecting the rebase might require retouching some of this code significantly. If so, I can review. Otherwise, r=me
Before merging, I would like us to look more deeply into #109482 (comment). rn this lints triggers for |
I think the extension to implied bounds is certainly possible. But I think a sensible extension won't be small and small extension won't be simple. The sensible extension is to effectively allow types to have implied bounds from trait impls. The simple extension is to change nothing and continue to let this compile. |
blocked on rust-lang/types-team#99, unnominating |
let ty = OpportunisticRegionResolver::new(self).fold_ty(ty); | ||
if ty.has_infer() { | ||
// Infer vars can appear only in invalid code. See #110161. | ||
self.tcx.sess.delay_span_bug(DUMMY_SP, "infer vars in implied bounds"); |
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.
For the record, this line should be removed when/if this is rebased #115559
In case it's needed I was playing with this PR and "rebased" it in https://github.com/spastorino/rust/tree/lint-implied-bounds |
lint incorrect implied bounds in wfcheck except for Bevy dependents Rebase of rust-lang#109763 Additionally, special cases Bevy `ParamSet` types to not trigger the lint. Opening for crater r? `@ghost`
lint incorrect implied bounds in wfcheck except for Bevy dependents Rebase of rust-lang#109763 Additionally, special cases Bevy `ParamSet` types to not trigger the lint. Opening for crater r? `@ghost`
lint incorrect implied bounds in wfcheck except for Bevy dependents Rebase of rust-lang#109763 Additionally, special cases Bevy `ParamSet` types to not trigger the lint. Opening for crater r? `@ghost`
…ted-tests, r=jackh726 Add tests related to normalization in implied bounds Getting `@aliemjay's` tests from rust-lang#109763, so we can better track what's going on in every different example. r? `@jackh726`
…ted-tests, r=jackh726 Add tests related to normalization in implied bounds Getting ``@aliemjay's`` tests from rust-lang#109763, so we can better track what's going on in every different example. r? ``@jackh726``
…ted-tests, r=jackh726 Add tests related to normalization in implied bounds Getting ```@aliemjay's``` tests from rust-lang#109763, so we can better track what's going on in every different example. r? ```@jackh726```
Rollup merge of rust-lang#118512 - spastorino:add-implied-bounds-related-tests, r=jackh726 Add tests related to normalization in implied bounds Getting ```@aliemjay's``` tests from rust-lang#109763, so we can better track what's going on in every different example. r? ```@jackh726```
error on incorrect implied bounds in wfcheck except for Bevy dependents Rebase of rust-lang#109763 Additionally, special cases Bevy `ParamSet` types to not trigger the lint. This is tracked in rust-lang#119956. Fixes rust-lang#109628
Closing since #118553 landed. |
Lint version of #109482.
This implements a new implied bounds query that fixes the normalization problems with the previous query, including #106569, #109628 and #109799. While the new implementation allows more code to compile, it also breaks code that relies on #109628 (see the crater run in #109482 for details.) For this reason we keep the legacy implementation and emit a lint when they disagree.
Fixes #109628.
This doesn't implement the lint yet. I want to have a perf baseline first.r? @ghost