Skip to content

Commit

Permalink
Unrolled build for rust-lang#133558
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#133558 - compiler-errors:structurally-resolve-probe-adt, r=lcnr

Structurally resolve in `probe_adt`

fixes rust-lang#132320

r? lcnr
  • Loading branch information
rust-timer authored Dec 3, 2024
2 parents 490b2cc + 0609b99 commit d1f0e3e
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 d1f0e3e

Please sign in to comment.