|
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};
|
@@ -312,13 +311,10 @@ impl<'a, 'tcx, F: FnMut(DefId) -> bool> TypeFolder<TyCtxt<'tcx>>
|
312 | 311 | }
|
313 | 312 |
|
314 | 313 | fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
|
315 |
| - if let Some(ty_did) = t.ty_def_id() |
316 |
| - && (self.did_has_local_parent)(ty_did) |
| 314 | + if let Some(def) = t.ty_adt_def() |
| 315 | + && (self.did_has_local_parent)(def.did()) |
317 | 316 | {
|
318 |
| - self.infcx.next_ty_var(TypeVariableOrigin { |
319 |
| - kind: TypeVariableOriginKind::TypeInference, |
320 |
| - span: self.infer_span, |
321 |
| - }) |
| 317 | + self.infcx.next_ty_var(TypeVariableOrigin { param_def_id: None, span: self.infer_span }) |
322 | 318 | } else {
|
323 | 319 | t.super_fold_with(self)
|
324 | 320 | }
|
|
0 commit comments