-
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
Call poly_project_and_unify_type on types that contain inference types #56838
Conversation
Commit f57247c (Ensure that Rusdoc discovers all necessary auto trait bounds) added a check to ensure that we only attempt to unify a projection predicatre with inference variables. However, the check it added was too strict - instead of checking that a type *contains* an inference variable (e.g. '&_', 'MyType<_>'), it required the type to *be* an inference variable (i.e. only '_' would match). This commit relaxes the check to use 'ty.has_infer_types', ensuring that we perform unification wherever possible. Fixes rust-lang#56822
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
Awesome, thanks! |
Thanks for this fix @Aaron1011! This is blocking upgrading the compiler in Servo (which is needed because of unrelated changes to unstable features). |
@bors r+ |
📌 Commit a375410 has been approved by |
@bors p=1 -- blocking servo |
@Aaron1011 #56822 is not tagged as a regression, so I am assuming no beta backport is required here? |
Call poly_project_and_unify_type on types that contain inference types Commit f57247c (Ensure that Rusdoc discovers all necessary auto trait bounds) added a check to ensure that we only attempt to unify a projection predicatre with inference variables. However, the check it added was too strict - instead of checking that a type *contains* an inference variable (e.g. '&_', 'MyType<_>'), it required the type to *be* an inference variable (i.e. only '_' would match). This commit relaxes the check to use 'ty.has_infer_types', ensuring that we perform unification wherever possible. Fixes #56822
☀️ Test successful - status-appveyor, status-travis |
@nikomatsakis #56822 is a regression in the sense that As to backporting, I first reproduced in 1.32.0-nightly (f4a421e 2018-12-13) which suggests we should backport this fix to 1.32 beta, but somehow I can’t reproduce in 1.32.0-beta.6 (a01b0bf 2018-12-19) so I’m not sure. |
That Nightly is the first after there hadn’t been one for a few days, so the regression range is kinda large: git log --oneline --merges 4a45578...f4a421e |
I can confirm that this fix (or at least everything from my previous testing up to As such, I'd very much like to request the fix be backported to 1.32 if there's time, as it will unblock some docs work I wanted to get done in the new year. |
Not sure who normally gets to do that, but tagged as |
Accepting beta nomination based on the fact that #56296 is affecting stable. |
This doesn't apply cleanly to beta, since the code on the beta branch is different. Can someone prepare a backport PR against beta? Thanks! |
@pietroalbini Is that the same bug? I could not reproduce #56822 on 1.32.0-beta.6 (and it never reached stable as far as I know). |
Dunno, just saw the beta-accepted label and tried to backport it. |
@Aaron1011 is there any chance of that, or has too much changed? |
Ping @nikomatsakis @Aaron1011 @QuietMisdreavus, can someone prepare a beta backport PR? |
@pietroalbini: This PR builds off of #55318 - both are necessary to fix the underlying issue. Should I prepare a PR containing the commits from this PR and #55318 ? |
That PR will need to be approved for backport as well then. |
[beta] Rollup backports Cherry-picked: * #57053: Fix alignment for array indexing * #57181: resolve: Fix another ICE in import validation * #57185: resolve: Fix one more ICE in import validation * #57282: Wf-check the output type of a function in MIR-typeck * #55318: Ensure that Rustdoc discovers all necessary auto trait bounds * #56838: Call poly_project_and_unify_type on types that contain inference types Rolled up: * #57300: [beta] Update RLS to include 100% CPU on hover bugfix * #57301: beta: bootstrap from latest stable (1.31.1) * #57292: [BETA] Update cargo r? @ghost
Commit f57247c (Ensure that Rusdoc discovers all necessary auto
trait bounds) added a check to ensure that we only attempt to unify a
projection predicatre with inference variables. However, the check it
added was too strict - instead of checking that a type contains an
inference variable (e.g. '&', 'MyType<>'), it required the type to
be an inference variable (i.e. only '_' would match).
This commit relaxes the check to use 'ty.has_infer_types', ensuring that
we perform unification wherever possible.
Fixes #56822