From 5ca6bd50b584bc157eac783f2a2251424382351f Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Sun, 6 Jan 2019 16:04:00 +0000 Subject: [PATCH] Rename CanonicalUserTypeAnnotation -> CanonicalUserType We want the name `CanonicalUserTypeAnnotation` for our own use. --- src/librustc/ty/context.rs | 12 ++++++------ src/librustc/ty/mod.rs | 2 +- src/librustc_mir/hair/cx/expr.rs | 2 +- src/librustc_mir/hair/pattern/mod.rs | 6 +++--- src/librustc_mir/hair/util.rs | 4 ++-- src/librustc_typeck/check/mod.rs | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 32d2314bef19..ef8f7bd9a756 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -350,7 +350,7 @@ pub struct TypeckTables<'tcx> { /// canonical substitutions would include only `for { Vec }`. /// /// See also `AscribeUserType` statement in MIR. - user_provided_types: ItemLocalMap>, + user_provided_types: ItemLocalMap>, /// Stores the canonicalized types provided by the user. See also /// `AscribeUserType` statement in MIR. @@ -493,7 +493,7 @@ impl<'tcx> TypeckTables<'tcx> { pub fn user_provided_types( &self - ) -> LocalTableInContext<'_, CanonicalUserTypeAnnotation<'tcx>> { + ) -> LocalTableInContext<'_, CanonicalUserType<'tcx>> { LocalTableInContext { local_id_root: self.local_id_root, data: &self.user_provided_types @@ -502,7 +502,7 @@ impl<'tcx> TypeckTables<'tcx> { pub fn user_provided_types_mut( &mut self - ) -> LocalTableInContextMut<'_, CanonicalUserTypeAnnotation<'tcx>> { + ) -> LocalTableInContextMut<'_, CanonicalUserType<'tcx>> { LocalTableInContextMut { local_id_root: self.local_id_root, data: &mut self.user_provided_types @@ -807,12 +807,12 @@ newtype_index! { /// Mapping of type annotation indices to canonical user type annotations. pub type CanonicalUserTypeAnnotations<'tcx> = - IndexVec)>; + IndexVec)>; /// Canonicalized user type annotation. -pub type CanonicalUserTypeAnnotation<'gcx> = Canonical<'gcx, UserType<'gcx>>; +pub type CanonicalUserType<'gcx> = Canonical<'gcx, UserType<'gcx>>; -impl CanonicalUserTypeAnnotation<'gcx> { +impl CanonicalUserType<'gcx> { /// Returns `true` if this represents a substitution of the form `[?0, ?1, ?2]`, /// i.e. each thing is mapped to a canonical variable with the same index. pub fn is_identity(&self) -> bool { diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index ff7220deb768..a6e226302e51 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -73,7 +73,7 @@ pub use self::binding::BindingMode::*; pub use self::context::{TyCtxt, FreeRegionInfo, GlobalArenas, AllArenas, tls, keep_local}; pub use self::context::{Lift, TypeckTables, CtxtInterners}; pub use self::context::{ - UserTypeAnnotationIndex, UserType, CanonicalUserTypeAnnotation, + UserTypeAnnotationIndex, UserType, CanonicalUserType, CanonicalUserTypeAnnotations, }; diff --git a/src/librustc_mir/hair/cx/expr.rs b/src/librustc_mir/hair/cx/expr.rs index e86e5f342597..8d64c9e9ada8 100644 --- a/src/librustc_mir/hair/cx/expr.rs +++ b/src/librustc_mir/hair/cx/expr.rs @@ -797,7 +797,7 @@ fn user_substs_applied_to_def( cx: &mut Cx<'a, 'gcx, 'tcx>, hir_id: hir::HirId, def: &Def, -) -> Option> { +) -> Option> { debug!("user_substs_applied_to_def: def={:?}", def); let user_provided_type = match def { // A reference to something callable -- e.g., a fn, method, or diff --git a/src/librustc_mir/hair/pattern/mod.rs b/src/librustc_mir/hair/pattern/mod.rs index cabc854510fa..7aaf74ae18fb 100644 --- a/src/librustc_mir/hair/pattern/mod.rs +++ b/src/librustc_mir/hair/pattern/mod.rs @@ -15,7 +15,7 @@ use rustc::mir::{fmt_const_val, Field, BorrowKind, Mutability}; use rustc::mir::{ProjectionElem, UserTypeProjection}; use rustc::mir::interpret::{Scalar, GlobalId, ConstValue, sign_extend}; use rustc::ty::{self, Region, TyCtxt, AdtDef, Ty, Lift}; -use rustc::ty::{CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, UserType}; +use rustc::ty::{CanonicalUserType, CanonicalUserTypeAnnotations, UserType}; use rustc::ty::subst::{Substs, Kind}; use rustc::ty::layout::VariantIdx; use rustc::hir::{self, PatKind, RangeEnd}; @@ -60,12 +60,12 @@ pub struct Pattern<'tcx> { #[derive(Clone, Debug)] pub struct PatternTypeProjection<'tcx> { - pub base: CanonicalUserTypeAnnotation<'tcx>, + pub base: CanonicalUserType<'tcx>, pub projs: Vec>, } impl<'tcx> PatternTypeProjection<'tcx> { - pub(crate) fn from_user_type(user_annotation: CanonicalUserTypeAnnotation<'tcx>) -> Self { + pub(crate) fn from_user_type(user_annotation: CanonicalUserType<'tcx>) -> Self { Self { base: user_annotation, projs: Vec::new(), diff --git a/src/librustc_mir/hair/util.rs b/src/librustc_mir/hair/util.rs index 2fd3a089a998..cb4a72387fa1 100644 --- a/src/librustc_mir/hair/util.rs +++ b/src/librustc_mir/hair/util.rs @@ -1,5 +1,5 @@ use rustc::hir; -use rustc::ty::{self, CanonicalUserTypeAnnotation, TyCtxt, UserType}; +use rustc::ty::{self, CanonicalUserType, TyCtxt, UserType}; crate trait UserAnnotatedTyHelpers<'gcx: 'tcx, 'tcx> { fn tcx(&self) -> TyCtxt<'_, 'gcx, 'tcx>; @@ -12,7 +12,7 @@ crate trait UserAnnotatedTyHelpers<'gcx: 'tcx, 'tcx> { fn user_substs_applied_to_ty_of_hir_id( &self, hir_id: hir::HirId, - ) -> Option> { + ) -> Option> { let user_provided_types = self.tables().user_provided_types(); let mut user_ty = *user_provided_types.get(hir_id)?; debug!("user_subts_applied_to_ty_of_hir_id: user_ty={:?}", user_ty); diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index e4e4f1bc4d4d..54fd7de381f2 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -103,7 +103,7 @@ use rustc::middle::region; use rustc::mir::interpret::{ConstValue, GlobalId}; use rustc::traits::{self, ObligationCause, ObligationCauseCode, TraitEngine}; use rustc::ty::{ - self, AdtKind, CanonicalUserTypeAnnotation, Ty, TyCtxt, GenericParamDefKind, Visibility, + self, AdtKind, CanonicalUserType, Ty, TyCtxt, GenericParamDefKind, Visibility, ToPolyTraitRef, ToPredicate, RegionKind, UserType }; use rustc::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase, AutoBorrow, AutoBorrowMutability}; @@ -2252,7 +2252,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { pub fn write_user_type_annotation( &self, hir_id: hir::HirId, - canonical_user_type_annotation: CanonicalUserTypeAnnotation<'tcx>, + canonical_user_type_annotation: CanonicalUserType<'tcx>, ) { debug!( "write_user_type_annotation: hir_id={:?} canonical_user_type_annotation={:?} tag={}",