Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
a6e8835 to
dd64102
Compare
|
hmm, have thoughts here, let's chat on zulip https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/unnormalized.20aliases.20after.20normalizatoon/with/630957987 |
dd64102 to
759d050
Compare
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
759d050 to
93b0744
Compare
NormalizesTo::match_assumption93b0744 to
aef73eb
Compare
|
I also factored out the placeholder replacement code into a new |
This comment has been minimized.
This comment has been minimized.
|
seems to be a spurious network failure 🤔 |
|
Yeah, re-triggered the CI and it's green |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rerun normalization on non-rigid higher-ranked aliases
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (4b7717e): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary 0.1%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.1%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 488.483s -> 487.017s (-0.30%) |
|
r? adwinwhite |
| // The solver can return a term which still contains non-rigid aliases with escaping | ||
| // bound vars, as the generalizer does not replace those with inference vars. In this | ||
| // case, also want those aliases to be normalized. |
There was a problem hiding this comment.
| // The solver can return a term which still contains non-rigid aliases with escaping | |
| // bound vars, as the generalizer does not replace those with inference vars. In this | |
| // case, also want those aliases to be normalized. | |
| // The solver can return a term which still contains non-rigid aliases with escaping | |
| // bound vars. Those aliases could be normalized but aren't, because we only | |
| // constrain infer vars after their normalization finishes. In this case, we normalize | |
| // them again with resolved vars. |
There was a problem hiding this comment.
We should have a test that actually exercise this code. But constructing one is hard. So 🤷
| //@ compile-flags: -Znext-solver | ||
| //@ check-pass | ||
|
|
||
| // regression test for https://github.com/rust-lang/rust/issues/163817 |
There was a problem hiding this comment.
| // regression test for https://github.com/rust-lang/rust/issues/163817 | |
| // Regression test for https://github.com/rust-lang/rust/issues/163817 | |
| // We previously didn't normalize term from assumption and returned term | |
| // containing non-rigid aliases as normalized result. |
| //@ compile-flags: -Znext-solver | ||
| //@ check-pass | ||
|
|
||
| // regression test for https://github.com/rust-lang/rust/issues/163817 |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
aef73eb to
7195d4f
Compare
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Adwin White <adwinw01@gmail.com>
7195d4f to
cb2105b
Compare
|
This PR was rebased onto a different main 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. |
|
Thank you! Sorry for not doing this earlier, I've been quite busy these past few weeks. I've applied all the comment changes. unfortunately I couldn't find a test that exercises that specific case in @rustbot review |
No worries ^^
This is missing :3
We can add a FIXME there, saying that we should have a test. @rustbot author |
Co-authored-by: Adwin White <adwinw01@gmail.com>
cb2105b to
28df594
Compare
oh wow I completely forgot about that somehow. added this and the FIXME :D @rustbot review |
|
Found another test for the first commit. Could be a test for the second commit if we don't have the first commit 🤣 // Adapted from `find-param-recursion-issue-152716.rs`
trait Trait<'a> { type Assoc; }
fn foo<T>()
where
T: for<'a> Trait<'a, Assoc = for<'b> fn(<T as Trait<'b>>::Assoc)>,
{}Could you add this for the first commit? r=me after adding the test. Thanks for working on this :> |
|
✌️ @sjwang05, you can now approve this pull request! If @adwinwhite told you to " |
|
☔ The latest upstream changes (presumably #166716) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
View all comments
View all comments
Previously we didn't normalize terms from assumptions, leading to that
ecx.normalizereturned non-rigid aliases.Even after fixing that, the normalization routine can still return non-rigid aliases without pending obligations, because we can fail to normalize higher ranked aliases due to unresolved vars but the vars are resolved eventually.
We now rerun normalization on the normalized term if it still contains non-rigid aliases to mitigate this.
fixes #163817
r? project-trait-system-refactor