-
Notifications
You must be signed in to change notification settings - Fork 14k
prefer alias candidates for sizedness + auto trait goals #144064
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
prefer alias candidates for sizedness + auto trait goals #144064
Conversation
This comment has been minimized.
This comment has been minimized.
|
wrt 6aa3732 it's not that we stop to normalize the predicates of projections, it's that when comfirming alias-bound/ wrt
Did you already crater run this behavior? |
We did a crater run in #142712 (comment), which had all of these changes and included implying |
6aa3732 to
e412062
Compare
|
Updated the README and corrected the descriptions of everything per your comment |
This comment was marked as resolved.
This comment was marked as resolved.
e412062 to
fa46ce0
Compare
|
Rebased following #143545 |
This comment was marked as resolved.
This comment was marked as resolved.
fa46ce0 to
f1e23b5
Compare
|
This PR does two relevant changes we need to FCP. We've already tried the first change before in #92191 and then reverted the PR as this caused a regression. The second change is necessary to avoid this regression and is also generally desirable.
|
|
Team member @lcnr has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
|
@bors rollup=never Just so it's easier to bisect later if it causes issues |
…, r=lcnr prefer alias candidates for sizedness + auto trait goals Fixes #143992 - abd07de: Reverts #144016 so that `MetaSized` bounds are checked properly, and updates all the tests accordingly, including making `tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs` fail when it shouldn't - 90e61db: Prefer alias candidates over parameter environment candidates for sizedness, auto and default traits. `tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs` passes again, but `tests/ui/generic-associated-types/issue-93262.rs` starts failing when it shouldn't - e412062: No longer require that predicates of aliases hold in well-formedness checking of the alias. `tests/ui/generic-associated-types/issue-93262.rs` passes again Each commit updates all the tests to their new output so it should be easy enough to see what the impact of each change individually is. After all of the changes, tests that pass when they didn't before or vice versa: - `tests/ui/extern/extern-types-size_of_val.rs` - Previously passing, but only because of #144016, now correctly errors - `tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs` - Previously failing on next solver, only because #144016 only applied to the old solver, passing now with 90e61db - `tests/ui/sized-hierarchy/overflow.rs` - Previously passing, but only because of #144016, now correctly errors - `tests/ui/generic-associated-types/issue-92096.rs` - Previously passing, due to e412062 - Fails to prove `C::Connecting<'placeholder>: Send` which is required when proving that the generator is `Send`. This is an instance of #110338. - `tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution-opaque-type.rs` - Previously passing, now failing in the next solver, due to 03e0fda - Expected that this test now fails as ambigious, see [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/144729-t-types/topic/sizedness.20bounds.20in.20explicit_implied_predicates_of.20.28.23142712.29/near/526987384) This had a crater run in #142712 (comment) alongside some other changes. r? `@lcnr` cc #142712 (this extracts part of that change)
|
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
For sizedness, default and auto trait predicates, now prefer non-param candidates if any exist. As these traits do not have generic parameters, it never makes sense to prefer an non-alias candidate, as there can never be a more permissive candidate.
No longer require that we prove that the predicates of aliases hold when checking the well-formedness of the alias. This permits more uses of GATs and changes the output of yet more tests.
8287fb0 to
519d6cd
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r=lcnr |
|
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 3f2a592 (parent) -> 57ef8d6 (this PR) Test differencesShow 78 test diffsStage 1
Stage 2
Additionally, 66 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 57ef8d642d21965304bde849bab4f389b4353e27 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (57ef8d6): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.8%, secondary 0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.6%, secondary -3.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 476.725s -> 476.546s (-0.04%) |
|
Fix for a regression. Generally fairly neutral so further investigation doesn't seem warranted. |
…nds, r=lcnr hir_analysis: add missing sizedness bounds Depends on #144064 Default sizedness bounds were not being added to `explicit_super_predicates_of` and `explicit_implied_predicates_of` which meant that a trait bound added to a associated type projection would be missing the implied predicate of the default sizedness supertrait of that trait. An unexpected consequence of this change was that the check for multiple principals was now finding an additional `MetaSized` principal when eagerly expanding trait aliases - which is fixed by skipping `MetaSized` when elaborating trait aliases in lowering `dyn TraitAlias`.
Fixes #143992
MetaSizedalways holds temporarily #144016 so thatMetaSizedbounds are checked properly, and updates all the tests accordingly, including makingtests/ui/sized-hierarchy/incomplete-inference-issue-143992.rsfail when it shouldn'ttests/ui/sized-hierarchy/incomplete-inference-issue-143992.rspasses again, buttests/ui/generic-associated-types/issue-93262.rsstarts failing when it shouldn'ttests/ui/generic-associated-types/issue-93262.rspasses againEach commit updates all the tests to their new output so it should be easy enough to see what the impact of each change individually is. After all of the changes, tests that pass when they didn't before or vice versa:
tests/ui/extern/extern-types-size_of_val.rsMetaSizedalways holds temporarily #144016, now correctly errorstests/ui/sized-hierarchy/incomplete-inference-issue-143992.rsMetaSizedalways holds temporarily #144016 only applied to the old solver, passing now with 90e61dbtests/ui/sized-hierarchy/overflow.rsMetaSizedalways holds temporarily #144016, now correctly errorstests/ui/generic-associated-types/issue-92096.rsC::Connecting<'placeholder>: Sendwhich is required when proving that the generator isSend. This is an instance of Tracking issue for incorrect lifetime bound errors in async #110338.tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution-opaque-type.rsThis had a crater run in #142712 (comment) alongside some other changes.
r? @lcnr
cc #142712 (this extracts part of that change)