Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 49df325

Browse filesBrowse files
authored
Rollup merge of #133558 - compiler-errors:structurally-resolve-probe-adt, r=lcnr
Structurally resolve in `probe_adt` fixes #132320 r? lcnr
2 parents 453a1a8 + 0609b99 commit 49df325
Copy full SHA for 49df325

File tree

Expand file treeCollapse file tree

3 files changed

+20
-16
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+20
-16
lines changed

‎compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs

Copy file name to clipboardExpand all lines: compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,11 @@ impl<'tcx> HirTyLowerer<'tcx> for FnCtxt<'_, 'tcx> {
307307
ty::Alias(ty::Projection | ty::Inherent | ty::Weak, _)
308308
if !ty.has_escaping_bound_vars() =>
309309
{
310-
self.normalize(span, ty).ty_adt_def()
310+
if self.next_trait_solver() {
311+
self.try_structurally_resolve_type(span, ty).ty_adt_def()
312+
} else {
313+
self.normalize(span, ty).ty_adt_def()
314+
}
311315
}
312316
_ => None,
313317
}

‎tests/crashes/132320.rs

Copy file name to clipboardExpand all lines: tests/crashes/132320.rs
-15Lines changed: 0 additions & 15 deletions
This file was deleted.
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ check-pass
2+
//@ compile-flags: -Znext-solver
3+
4+
trait Mirror {
5+
type Assoc;
6+
}
7+
impl<T> Mirror for T {
8+
type Assoc = T;
9+
}
10+
11+
type Foo<T> = <Option<T> as Mirror>::Assoc;
12+
13+
fn main() {
14+
let x = Foo::<i32>::None;
15+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.