mirror of
https://github.com/rust-lang/rust
synced 2024-10-06 08:40:35 +00:00
also remap RPITITs nested in other types back to their opaques
This commit is contained in:
parent
31a05a227a
commit
5a2b335e49
|
@ -4,7 +4,7 @@
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_infer::traits::util;
|
use rustc_infer::traits::util;
|
||||||
use rustc_middle::ty::GenericArgs;
|
use rustc_middle::ty::GenericArgs;
|
||||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeFolder};
|
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable};
|
||||||
use rustc_span::def_id::{DefId, LocalDefId};
|
use rustc_span::def_id::{DefId, LocalDefId};
|
||||||
use rustc_span::Span;
|
use rustc_span::Span;
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
|
||||||
{
|
{
|
||||||
self.tcx.type_of(projection_ty.def_id).instantiate(self.tcx, projection_ty.args)
|
self.tcx.type_of(projection_ty.def_id).instantiate(self.tcx, projection_ty.args)
|
||||||
} else {
|
} else {
|
||||||
ty
|
ty.super_fold_with(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,10 @@ trait Foo {
|
||||||
fn foo() -> impl Deref<Target = impl Deref<Target = impl Sized>> {
|
fn foo() -> impl Deref<Target = impl Deref<Target = impl Sized>> {
|
||||||
&&()
|
&&()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn bar() -> impl Deref<Target = Option<impl Sized>> {
|
||||||
|
&Some(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
Loading…
Reference in a new issue