-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
implied_bounds: deal with inference vars #102016
Conversation
aad324e
to
72a2102
Compare
I'm wondering if #101680 also fixes it... |
would assume no, because you still eagerly look at There may be other examples where ignoring infer vars from normalization causes us to fail to prove some outlives obligation which isn't added by the implied bounds query itself 😅 because of that I wouldn't be too comfortable with only merging your pr, even if that were to fix this specific test |
Just checked, it does fix it. Now I'm wondering if I could find a minimal repro of a case that fails without my PR (and more-so with yours). I only really found the bug my PR aims to solve by making other changes (that didn't quite work anyways). I don't think yours solves that bug. However, I have to think a little bit about why my PR does solve this test, since it seems to be because of not resolving the var before computing components. If I had to guess, the reason my PR fixes the issue, is because we properly register everything as implied, not constraints, even though it's an unresolved inference var. But then later we normalize and register everything properly. I think the fully correct behavior is the intersection between these two PRs: we should be resolving variables before computing components for them and we shouldn't be registering implied bounds as constraints. Two things I'd like to know about this (even though I'm not sure it's needed for this PR):
r? @jackh726 |
The answers to the above are 1) No, it builds fine with this PR 2) No, the test passes. |
@bors r+ |
Since this fixes a regression in 1.65, I'm nominating for beta backport. |
…jackh726 implied_bounds: deal with inference vars fixes rust-lang#101951 while computing implied bounds for `<<T as ConstructionFirm>::Builder as BuilderFn<'_>>::Output` normalization replaces a projection with an inference var (adding a `Projection` obligation). Until we prove that obligation, this inference var remains unknown, which caused us to miss an implied bound necessary to prove that the unnormalized projection from the trait method signature is wf. r? types
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#102016 (implied_bounds: deal with inference vars) - rust-lang#102161 (Resolve async fn signature even without body (e.g., in trait)) - rust-lang#102216 (rustdoc: Stabilize --diagnostic-width) - rust-lang#102240 (rustdoc: remove unused CSS `#main-content > .line-numbers`) - rust-lang#102242 (rustdoc: remove unused CSS `.summary`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
[beta] backports * Avoid duplicating StorageLive in let-else rust-lang#101894 * Re-add HRTB implied static bug note rust-lang#101924 * Revert "Copy stage0 binaries into stage0-sysroot" rust-lang#101942 * implied_bounds: deal with inference vars rust-lang#102016 * fix ConstProp handling of written_only_inside_own_block_locals rust-lang#102045 * Fix wrongly refactored Lift impl rust-lang#102088 * Fix a typo “pararmeter” in error message rust-lang#102119 * Deny associated type bindings within associated type bindings rust-lang#102338 * Continue migration of CSS themes rust-lang#101934 * Fix search result colors rust-lang#102369 * Fix unwind drop glue for if-then scopes rust-lang#102394 * Revert "Use getentropy when possible on all Apple platforms" rust-lang#102693 * Fix associated type bindings with anon const in GAT position rust-lang#102336 * Revert perf-regression 101620 rust-lang#102064 * `EscapeAscii` is not an `ExactSizeIterator` rust-lang#99880
fixes #101951
while computing implied bounds for
<<T as ConstructionFirm>::Builder as BuilderFn<'_>>::Output
normalization replaces a projection with an inference var (adding aProjection
obligation). Until we prove that obligation, this inference var remains unknown, which caused us to miss an implied bound necessary to prove that the unnormalized projection from the trait method signature is wf.r? types