mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
Rollup merge of #133558 - compiler-errors:structurally-resolve-probe-adt, r=lcnr
Structurally resolve in `probe_adt` fixes #132320 r? lcnr
This commit is contained in:
commit
49df325cb4
@ -307,7 +307,11 @@ impl<'tcx> HirTyLowerer<'tcx> for FnCtxt<'_, 'tcx> {
|
|||||||
ty::Alias(ty::Projection | ty::Inherent | ty::Weak, _)
|
ty::Alias(ty::Projection | ty::Inherent | ty::Weak, _)
|
||||||
if !ty.has_escaping_bound_vars() =>
|
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,
|
_ => None,
|
||||||
}
|
}
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
//@ known-bug: #132320
|
|
||||||
//@ compile-flags: -Znext-solver=globally
|
|
||||||
|
|
||||||
trait Foo {
|
|
||||||
type Item;
|
|
||||||
fn foo(&mut self);
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Foo for () {
|
|
||||||
type Item = Option<()>;
|
|
||||||
|
|
||||||
fn foo(&mut self) {
|
|
||||||
let _ = Self::Item::None;
|
|
||||||
}
|
|
||||||
}
|
|
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user