Only expand types that contain projections
This commit is contained in:
parent
fe09bb518d
commit
802554f427
1 changed files with 3 additions and 1 deletions
|
@ -745,8 +745,10 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
|
||||
if let ty::Opaque(def_id, substs) = t.kind {
|
||||
self.expand_opaque_ty(def_id, substs).unwrap_or(t)
|
||||
} else {
|
||||
} else if t.has_projections() {
|
||||
t.super_fold_with(self)
|
||||
} else {
|
||||
t
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue