Skip to content

Commit

Permalink
Structurally resolve in probe_adt
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Dec 2, 2024
1 parent d49be02 commit 0609b99
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
6 changes: 5 additions & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@ impl<'tcx> HirTyLowerer<'tcx> for FnCtxt<'_, 'tcx> {
ty::Alias(ty::Projection | ty::Inherent | ty::Weak, _)
if !ty.has_escaping_bound_vars() =>
{
self.normalize(span, ty).ty_adt_def()
if self.next_trait_solver() {
self.try_structurally_resolve_type(span, ty).ty_adt_def()
} else {
self.normalize(span, ty).ty_adt_def()
}
}
_ => None,
}
Expand Down
15 changes: 0 additions & 15 deletions tests/crashes/132320.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//@ check-pass
//@ compile-flags: -Znext-solver

trait Mirror {
type Assoc;
}
impl<T> Mirror for T {
type Assoc = T;
}

type Foo<T> = <Option<T> as Mirror>::Assoc;

fn main() {
let x = Foo::<i32>::None;
}

0 comments on commit 0609b99

Please sign in to comment.