-
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
Fix Instance::resolve()
incorrectly returning specialized instances
#67662
Fix Instance::resolve()
incorrectly returning specialized instances
#67662
Conversation
9cb8cb7
to
d88a745
Compare
8525d2d
to
4cfd5c4
Compare
@oli-obk I assume that closing #67631 implies this should also fix the test failure I have in #67137, but rebasing onto @wesleywiser's branch still yields a failure for me :(. |
We only want to return specializations when `Reveal::All` is passed, not when `Reveal::UserFacing` is. Resolving this fixes several issues with the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization passes. Fixes rust-lang#66901
4cfd5c4
to
25a8b5d
Compare
Force pushed |
Hi @anp do you have the error details so I can look at them? |
It's the same error that highfive reports:
|
I guess we still need my PR for backwards compatibility of @anp's PR. I'll reopen |
I have no idea why your PR would change that test's behavior but I wonder if we shouldn't have |
I think oli said at one point that it would be a breaking change to allow const prop to surface this error? |
this is the problem, the use of the broken constant inside a never used function should not cause a hard error. |
@bors r+ |
📌 Commit 25a8b5d has been approved by |
let eligible = if !resolved_item.defaultness.is_default() { | ||
true | ||
} else if param_env.reveal == traits::Reveal::All { | ||
!trait_ref.needs_subst() |
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.
You might want an assert that !trait_ref.needs_infer()
.
Use Reveal::All in MIR optimizations Resolves some code review feedback in rust-lang#67662. Fixes rust-lang#68855 r? @eddyb
Use Reveal::All in MIR optimizations Resolves some code review feedback in rust-lang#67662. Fixes rust-lang#68855 r? @eddyb
Use Reveal::All in MIR optimizations Resolves some code review feedback in rust-lang#67662. Fixes rust-lang#68855 r? @eddyb
We only want to return specializations when
Reveal::All
is passed, notwhen
Reveal::UserFacing
is. Resolving this fixes several issues withthe
ConstProp
,SimplifyBranches
, andInline
MIR optimizationpasses.
Fixes #66901
Rebased on top of #67631
r? @oli-obk