diff options
| author | Michael Goulet <michael@errs.io> | 2022-11-26 21:21:20 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-12-13 17:34:44 +0000 |
| commit | 5c6afb850c29f5604f685bf4d4fea85a2deb7197 (patch) | |
| tree | b89915de1c6af256c67a1c2fe1fbdba8cb68cf70 /compiler/rustc_infer/src/infer | |
| parent | 7f3af726065d9eaabf93d87f22d97f60cca7a5f1 (diff) | |
| download | rust-5c6afb850c29f5604f685bf4d4fea85a2deb7197.tar.gz rust-5c6afb850c29f5604f685bf4d4fea85a2deb7197.zip | |
ProjectionTy.item_def_id -> ProjectionTy.def_id
Diffstat (limited to 'compiler/rustc_infer/src/infer')
8 files changed, 17 insertions, 17 deletions
diff --git a/compiler/rustc_infer/src/infer/at.rs b/compiler/rustc_infer/src/infer/at.rs index 4429e4f4362..1f2768f9884 100644 --- a/compiler/rustc_infer/src/infer/at.rs +++ b/compiler/rustc_infer/src/infer/at.rs @@ -419,8 +419,8 @@ impl<'tcx> ToTrace<'tcx> for ty::ProjectionTy<'tcx> { a: Self, b: Self, ) -> TypeTrace<'tcx> { - let a_ty = tcx.mk_projection(a.item_def_id, a.substs); - let b_ty = tcx.mk_projection(b.item_def_id, b.substs); + let a_ty = tcx.mk_projection(a.def_id, a.substs); + let b_ty = tcx.mk_projection(b.def_id, b.substs); TypeTrace { cause: cause.clone(), values: Terms(ExpectedFound::new(a_is_expected, a_ty.into(), b_ty.into())), diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index fea62133759..615452d019d 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -342,9 +342,9 @@ impl<'tcx> InferCtxt<'tcx> { let (def_id, substs) = match *ty.kind() { ty::Opaque(ty::OpaqueTy { def_id, substs }) => (def_id, substs), ty::Projection(data) - if self.tcx.def_kind(data.item_def_id) == DefKind::ImplTraitPlaceholder => + if self.tcx.def_kind(data.def_id) == DefKind::ImplTraitPlaceholder => { - (data.item_def_id, data.substs) + (data.def_id, data.substs) } _ => return None, }; @@ -358,7 +358,7 @@ impl<'tcx> InferCtxt<'tcx> { .kind() .map_bound(|kind| match kind { ty::PredicateKind::Clause(ty::Clause::Projection(projection_predicate)) - if projection_predicate.projection_ty.item_def_id == item_def_id => + if projection_predicate.projection_ty.def_id == item_def_id => { projection_predicate.term.ty() } @@ -1743,11 +1743,11 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { ) } (true, ty::Projection(proj)) - if self.tcx.def_kind(proj.item_def_id) + if self.tcx.def_kind(proj.def_id) == DefKind::ImplTraitPlaceholder => { let sm = self.tcx.sess.source_map(); - let pos = sm.lookup_char_pos(self.tcx.def_span(proj.item_def_id).lo()); + let pos = sm.lookup_char_pos(self.tcx.def_span(proj.def_id).lo()); format!( " (trait associated opaque type at <{}:{}:{}>)", sm.filename_for_diagnostics(&pos.file.name), diff --git a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs index fe134830d68..7cac038927c 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/suggest.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/suggest.rs @@ -509,7 +509,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { ( hir::ItemKind::OpaqueTy(hir::OpaqueTy { bounds: last_bounds, .. }), hir::ItemKind::OpaqueTy(hir::OpaqueTy { bounds: exp_bounds, .. }), - ) if iter::zip(*last_bounds, *exp_bounds).all(|(left, right)| { + ) if std::iter::zip(*last_bounds, *exp_bounds).all(|(left, right)| { match (left, right) { ( hir::GenericBound::Trait(tl, ml), diff --git a/compiler/rustc_infer/src/infer/opaque_types.rs b/compiler/rustc_infer/src/infer/opaque_types.rs index 495369031d1..25edfd0928a 100644 --- a/compiler/rustc_infer/src/infer/opaque_types.rs +++ b/compiler/rustc_infer/src/infer/opaque_types.rs @@ -490,10 +490,10 @@ where } ty::Projection(proj) - if self.tcx.def_kind(proj.item_def_id) == DefKind::ImplTraitPlaceholder => + if self.tcx.def_kind(proj.def_id) == DefKind::ImplTraitPlaceholder => { // Skip lifetime paramters that are not captures. - let variances = self.tcx.variances_of(proj.item_def_id); + let variances = self.tcx.variances_of(proj.def_id); for (v, s) in std::iter::zip(variances, proj.substs.iter()) { if *v != ty::Variance::Bivariant { @@ -568,7 +568,7 @@ impl<'tcx> InferCtxt<'tcx> { // FIXME(RPITIT): Don't replace RPITITs with inference vars. ty::Projection(projection_ty) if !projection_ty.has_escaping_bound_vars() - && tcx.def_kind(projection_ty.item_def_id) + && tcx.def_kind(projection_ty.def_id) != DefKind::ImplTraitPlaceholder => { self.infer_projection( @@ -588,7 +588,7 @@ impl<'tcx> InferCtxt<'tcx> { } // FIXME(RPITIT): This can go away when we move to associated types ty::Projection(proj) - if def_id.to_def_id() == proj.item_def_id && substs == proj.substs => + if def_id.to_def_id() == proj.def_id && substs == proj.substs => { hidden_ty } diff --git a/compiler/rustc_infer/src/infer/outlives/obligations.rs b/compiler/rustc_infer/src/infer/outlives/obligations.rs index 3fc3e6b09df..c496b040edb 100644 --- a/compiler/rustc_infer/src/infer/outlives/obligations.rs +++ b/compiler/rustc_infer/src/infer/outlives/obligations.rs @@ -355,11 +355,11 @@ where origin, region, GenericKind::Projection(projection_ty), - projection_ty.item_def_id, + projection_ty.def_id, projection_ty.substs, false, |ty| match ty.kind() { - ty::Projection(projection_ty) => (projection_ty.item_def_id, projection_ty.substs), + ty::Projection(projection_ty) => (projection_ty.def_id, projection_ty.substs), _ => bug!("expected only projection types from env, not {:?}", ty), }, ); diff --git a/compiler/rustc_infer/src/infer/outlives/verify.rs b/compiler/rustc_infer/src/infer/outlives/verify.rs index f470b2eb8c1..136da4a3cb1 100644 --- a/compiler/rustc_infer/src/infer/outlives/verify.rs +++ b/compiler/rustc_infer/src/infer/outlives/verify.rs @@ -178,7 +178,7 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> { ), Component::Projection(projection_ty) => self.projection_opaque_bounds( GenericKind::Projection(projection_ty), - projection_ty.item_def_id, + projection_ty.def_id, projection_ty.substs, visited, ), diff --git a/compiler/rustc_infer/src/infer/projection.rs b/compiler/rustc_infer/src/infer/projection.rs index eb6deee291c..d81e09fcb5d 100644 --- a/compiler/rustc_infer/src/infer/projection.rs +++ b/compiler/rustc_infer/src/infer/projection.rs @@ -21,7 +21,7 @@ impl<'tcx> InferCtxt<'tcx> { recursion_depth: usize, obligations: &mut Vec<PredicateObligation<'tcx>>, ) -> Ty<'tcx> { - let def_id = projection_ty.item_def_id; + let def_id = projection_ty.def_id; let ty_var = self.next_ty_var(TypeVariableOrigin { kind: TypeVariableOriginKind::NormalizeProjectionType, span: self.tcx.def_span(def_id), diff --git a/compiler/rustc_infer/src/infer/region_constraints/mod.rs b/compiler/rustc_infer/src/infer/region_constraints/mod.rs index 985c5d360db..7b0d0a9cb52 100644 --- a/compiler/rustc_infer/src/infer/region_constraints/mod.rs +++ b/compiler/rustc_infer/src/infer/region_constraints/mod.rs @@ -773,7 +773,7 @@ impl<'tcx> GenericKind<'tcx> { pub fn to_ty(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx> { match *self { GenericKind::Param(ref p) => p.to_ty(tcx), - GenericKind::Projection(ref p) => tcx.mk_projection(p.item_def_id, p.substs), + GenericKind::Projection(ref p) => tcx.mk_projection(p.def_id, p.substs), GenericKind::Opaque(def_id, substs) => tcx.mk_opaque(def_id, substs), } } |
