-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Remove special-casing around AliasKind::Opaque
when structurally resolving in new solver
#119817
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
{ | ||
return Some(ty); | ||
} | ||
if let DefineOpaqueTypes::No = define_opaque_types |
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 is copied from #118915, since otherwise Opaque alias-eq ?0
won't reveal the opaque in Reveal::All
mode.
The important part is the && let Reveal::UserFacing = param_env.reveal()
line, since in reveal-all mode, we don't care if opaques are local or not, we always want to reveal them.
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.
r=me on the impl, but I am blocking this on #118915
@@ -23,7 +23,7 @@ impl<'tcx> StructurallyNormalizeExt<'tcx> for At<'_, 'tcx> { | |||
|
|||
if self.infcx.next_trait_solver() { | |||
// FIXME(-Znext-solver): Should we resolve opaques here? |
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.
remove the fixme
7b4d04e
to
68c2f11
Compare
@bors r+ rollup (new solver) |
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#119817 (Remove special-casing around `AliasKind::Opaque` when structurally resolving in new solver) - rust-lang#119819 (Check rust lints when an unknown lint is detected) - rust-lang#119872 (Give me a way to emit all the delayed bugs as errors (add `-Zeagerly-emit-delayed-bugs`)) - rust-lang#119877 (Add more information to `visit_projection_elem`) - rust-lang#119884 (Rename `--env` option flag to `--env-set`) - rust-lang#119885 (Revert rust-lang#113923) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#119817 - compiler-errors:normalize-opaques, r=lcnr Remove special-casing around `AliasKind::Opaque` when structurally resolving in new solver This fixes a few inconsistencies around where we don't eagerly resolve opaques to their (locally-defined) hidden types in the new solver. It essentially allows this code to work: ```rust fn main() { type Tait = impl Sized; struct S { i: i32, } let x: Tait = S { i: 0 }; println!("{}", x.i); } ``` Since `Tait` is defined in `main`, we are able to poke through the type of `x` with deref. r? lcnr
This fixes a few inconsistencies around where we don't eagerly resolve opaques to their (locally-defined) hidden types in the new solver. It essentially allows this code to work:
Since
Tait
is defined inmain
, we are able to poke through the type ofx
with deref.r? lcnr