-
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
Don't check unsize goal in MIR validation when opaques remain #130989
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
6a02453
to
4af6137
Compare
It has been two weeks, so I'm gonna re-roll r? compiler |
// We sometimes have to use `defining_opaque_types` for predicates | ||
// to succeed here and figuring out how exactly that should work | ||
// is annoying. It is harmless enough to just not validate anything | ||
// in that case. We still check this after analysis as all opaque | ||
// types have been revealed at this point. |
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.
Should we not enforce this in some way?
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.
We don't enforce it anyways for mir_assign_valid_types
, so I don't see any reason to do so. I also don't think it would be easy to do.
if pred.has_opaque_types() { | ||
return true; | ||
} |
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.
I'm slightly concerned because we use predicate_must_hold_modulo_regions
in several places that don't necessarily have additional later checks. Are there negative tests where we can cause compilation failures even when triggering this code-path?
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.
Remember that this is just validation I added, and we validate MIR after opaques are revealed. I'm not totally certain if I understand the concern here.
r=me, with answers to the above, one way or another. |
This is a fix for validation that I just added, so I'm not too worried that the check is now relaxed, since fully validating pre-revealed opaque MIR is not really possible to do. @bors r=estebank rollup |
…stebank Don't check unsize goal in MIR validation when opaques remain Similarly to `mir_assign_valid_types`, let's just skip when there are opaques. Fixes rust-lang#130921.
needs a |
…stebank Don't check unsize goal in MIR validation when opaques remain Similarly to `mir_assign_valid_types`, let's just skip when there are opaques. Fixes rust-lang#130921.
@bors r- |
4af6137
to
c773098
Compare
@bors r=estebank |
…stebank Don't check unsize goal in MIR validation when opaques remain Similarly to `mir_assign_valid_types`, let's just skip when there are opaques. Fixes rust-lang#130921.
…stebank Don't check unsize goal in MIR validation when opaques remain Similarly to `mir_assign_valid_types`, let's just skip when there are opaques. Fixes rust-lang#130921.
Rollup of 10 pull requests Successful merges: - rust-lang#129181 (Pass end position of span through inline ASM cookie) - rust-lang#130989 (Don't check unsize goal in MIR validation when opaques remain) - rust-lang#131657 (Rustfmt `for<'a> async` correctly) - rust-lang#131691 (Delay ambiguous intra-doc link resolution after `Cache` has been populated) - rust-lang#131730 (Refactor some `core::fmt` macros) - rust-lang#131751 (Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe) - rust-lang#131753 (Unify `secondary_span` and `swap_secondary_and_primary` args in `note_type_err`) - rust-lang#131776 (Emscripten: Xfail backtrace ui tests) - rust-lang#131777 (Fix trivially_copy_pass_by_ref in stable_mir) - rust-lang#131778 (Fix needless_lifetimes in stable_mir) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#130989 (Don't check unsize goal in MIR validation when opaques remain) - rust-lang#131657 (Rustfmt `for<'a> async` correctly) - rust-lang#131691 (Delay ambiguous intra-doc link resolution after `Cache` has been populated) - rust-lang#131730 (Refactor some `core::fmt` macros) - rust-lang#131751 (Rename `can_coerce` to `may_coerce`, and then structurally resolve correctly in the probe) - rust-lang#131753 (Unify `secondary_span` and `swap_secondary_and_primary` args in `note_type_err`) - rust-lang#131776 (Emscripten: Xfail backtrace ui tests) - rust-lang#131777 (Fix trivially_copy_pass_by_ref in stable_mir) - rust-lang#131778 (Fix needless_lifetimes in stable_mir) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130989 - compiler-errors:unsize-opaque, r=estebank Don't check unsize goal in MIR validation when opaques remain Similarly to `mir_assign_valid_types`, let's just skip when there are opaques. Fixes rust-lang#130921.
Similarly to
mir_assign_valid_types
, let's just skip when there are opaques. Fixes #130921.