|
1 | 1 | use rustc_hir::{def::DefKind, Body, Item, ItemKind, Node, TyKind}; |
2 | 2 | use rustc_hir::{Path, QPath}; |
3 | | -use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; |
| 3 | +use rustc_infer::infer::type_variable::TypeVariableOrigin; |
4 | 4 | use rustc_infer::infer::InferCtxt; |
5 | 5 | use rustc_infer::traits::{Obligation, ObligationCause}; |
6 | | -use rustc_middle::query::Key; |
7 | 6 | use rustc_middle::ty::{self, Binder, Ty, TyCtxt, TypeFoldable, TypeFolder}; |
8 | 7 | use rustc_middle::ty::{EarlyBinder, TraitRef, TypeSuperFoldable}; |
9 | 8 | use rustc_span::def_id::{DefId, LOCAL_CRATE}; |
@@ -313,13 +312,10 @@ impl<'a, 'tcx, F: FnMut(DefId) -> bool> TypeFolder<TyCtxt<'tcx>> |
313 | 312 | } |
314 | 313 |
|
315 | 314 | fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> { |
316 | | - if let Some(ty_did) = t.ty_def_id() |
317 | | - && (self.did_has_local_parent)(ty_did) |
| 315 | + if let Some(def) = t.ty_adt_def() |
| 316 | + && (self.did_has_local_parent)(def.did()) |
318 | 317 | { |
319 | | - self.infcx.next_ty_var(TypeVariableOrigin { |
320 | | - kind: TypeVariableOriginKind::TypeInference, |
321 | | - span: self.infer_span, |
322 | | - }) |
| 318 | + self.infcx.next_ty_var(TypeVariableOrigin { param_def_id: None, span: self.infer_span }) |
323 | 319 | } else { |
324 | 320 | t.super_fold_with(self) |
325 | 321 | } |
|
0 commit comments