-
Notifications
You must be signed in to change notification settings - Fork 13.3k
do not emit OpaqueCast
projections with -Znext-solver
#139902
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
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @vakaras Some changes occurred in match lowering cc @Nadrieril |
// hidden types, so we don't need these projections anymore. | ||
// | ||
// Performance optimization: don't reintern if there is no `OpaqueCast` to remove. | ||
if place.projection.iter().any(|elem| matches!(elem, ProjectionElem::OpaqueCast(_))) { |
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.
this also affects the old solver as we now continue to super_visit
even if there are no opaque casts involved.
I think this is more correct as we want to normalize types and consts regardless of whether a projection contained an opaque.
Do we have tests that actually excercise this in the old solver where the tests are also run with the new solver? |
5200c77
to
111cabc
Compare
enabled two tests which started to fail with the old solver @bors r=oli-obk rollup |
111cabc
to
c85b5fc
Compare
@bors r=oli-obk rollup |
…oli-obk do not emit `OpaqueCast` projections with `-Znext-solver` We normalize opaque types in their defining scope if the new solver is enabled. This means projections do not contain any 'revealable' opaque types we need to worry about. We either have a type which has been normalized by writeback or we need to normalize it anyways. r? `@compiler-errors` `@oli-obk`
…oli-obk do not emit `OpaqueCast` projections with `-Znext-solver` We normalize opaque types in their defining scope if the new solver is enabled. This means projections do not contain any 'revealable' opaque types we need to worry about. We either have a type which has been normalized by writeback or we need to normalize it anyways. r? ``@compiler-errors`` ``@oli-obk``
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#139774 (Fix replacing supertrait aliases in `ReplaceProjectionWith`) - rust-lang#139850 (Hide unstable print kinds within emit_unknown_print_request_help in stable channel) - rust-lang#139870 (add retries to remove and create dir all) - rust-lang#139902 (do not emit `OpaqueCast` projections with `-Znext-solver`) - rust-lang#139931 (bootstrap: enable zlib for LLVM for Windows GNU) - rust-lang#139935 (Upgrade to `rustc-rayon-core` 0.5.1) - rust-lang#139943 (rustdoc: Support inlined cross-crate re-exported trait aliases) - rust-lang#139961 (Two `rustc_const_eval` cleanups) - rust-lang#139962 (opt-dist: add a flag for running tests) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139902 - lcnr:no-opaque-cast-projection, r=oli-obk do not emit `OpaqueCast` projections with `-Znext-solver` We normalize opaque types in their defining scope if the new solver is enabled. This means projections do not contain any 'revealable' opaque types we need to worry about. We either have a type which has been normalized by writeback or we need to normalize it anyways. r? ```@compiler-errors``` ```@oli-obk```
We normalize opaque types in their defining scope if the new solver is enabled. This means projections do not contain any 'revealable' opaque types we need to worry about. We either have a type which has been normalized by writeback or we need to normalize it anyways.
r? @compiler-errors @oli-obk