Skip to content

Commit 5ca6bd5

Browse files
committed
Rename CanonicalUserTypeAnnotation -> CanonicalUserType
We want the name `CanonicalUserTypeAnnotation` for our own use.
1 parent ab7bc3a commit 5ca6bd5

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

src/librustc/ty/context.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ pub struct TypeckTables<'tcx> {
350350
/// canonical substitutions would include only `for<X> { Vec<X> }`.
351351
///
352352
/// See also `AscribeUserType` statement in MIR.
353-
user_provided_types: ItemLocalMap<CanonicalUserTypeAnnotation<'tcx>>,
353+
user_provided_types: ItemLocalMap<CanonicalUserType<'tcx>>,
354354

355355
/// Stores the canonicalized types provided by the user. See also
356356
/// `AscribeUserType` statement in MIR.
@@ -493,7 +493,7 @@ impl<'tcx> TypeckTables<'tcx> {
493493

494494
pub fn user_provided_types(
495495
&self
496-
) -> LocalTableInContext<'_, CanonicalUserTypeAnnotation<'tcx>> {
496+
) -> LocalTableInContext<'_, CanonicalUserType<'tcx>> {
497497
LocalTableInContext {
498498
local_id_root: self.local_id_root,
499499
data: &self.user_provided_types
@@ -502,7 +502,7 @@ impl<'tcx> TypeckTables<'tcx> {
502502

503503
pub fn user_provided_types_mut(
504504
&mut self
505-
) -> LocalTableInContextMut<'_, CanonicalUserTypeAnnotation<'tcx>> {
505+
) -> LocalTableInContextMut<'_, CanonicalUserType<'tcx>> {
506506
LocalTableInContextMut {
507507
local_id_root: self.local_id_root,
508508
data: &mut self.user_provided_types
@@ -807,12 +807,12 @@ newtype_index! {
807807

808808
/// Mapping of type annotation indices to canonical user type annotations.
809809
pub type CanonicalUserTypeAnnotations<'tcx> =
810-
IndexVec<UserTypeAnnotationIndex, (Span, CanonicalUserTypeAnnotation<'tcx>)>;
810+
IndexVec<UserTypeAnnotationIndex, (Span, CanonicalUserType<'tcx>)>;
811811

812812
/// Canonicalized user type annotation.
813-
pub type CanonicalUserTypeAnnotation<'gcx> = Canonical<'gcx, UserType<'gcx>>;
813+
pub type CanonicalUserType<'gcx> = Canonical<'gcx, UserType<'gcx>>;
814814

815-
impl CanonicalUserTypeAnnotation<'gcx> {
815+
impl CanonicalUserType<'gcx> {
816816
/// Returns `true` if this represents a substitution of the form `[?0, ?1, ?2]`,
817817
/// i.e. each thing is mapped to a canonical variable with the same index.
818818
pub fn is_identity(&self) -> bool {

src/librustc/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub use self::binding::BindingMode::*;
7373
pub use self::context::{TyCtxt, FreeRegionInfo, GlobalArenas, AllArenas, tls, keep_local};
7474
pub use self::context::{Lift, TypeckTables, CtxtInterners};
7575
pub use self::context::{
76-
UserTypeAnnotationIndex, UserType, CanonicalUserTypeAnnotation,
76+
UserTypeAnnotationIndex, UserType, CanonicalUserType,
7777
CanonicalUserTypeAnnotations,
7878
};
7979

src/librustc_mir/hair/cx/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ fn user_substs_applied_to_def(
797797
cx: &mut Cx<'a, 'gcx, 'tcx>,
798798
hir_id: hir::HirId,
799799
def: &Def,
800-
) -> Option<ty::CanonicalUserTypeAnnotation<'tcx>> {
800+
) -> Option<ty::CanonicalUserType<'tcx>> {
801801
debug!("user_substs_applied_to_def: def={:?}", def);
802802
let user_provided_type = match def {
803803
// A reference to something callable -- e.g., a fn, method, or

src/librustc_mir/hair/pattern/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc::mir::{fmt_const_val, Field, BorrowKind, Mutability};
1515
use rustc::mir::{ProjectionElem, UserTypeProjection};
1616
use rustc::mir::interpret::{Scalar, GlobalId, ConstValue, sign_extend};
1717
use rustc::ty::{self, Region, TyCtxt, AdtDef, Ty, Lift};
18-
use rustc::ty::{CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, UserType};
18+
use rustc::ty::{CanonicalUserType, CanonicalUserTypeAnnotations, UserType};
1919
use rustc::ty::subst::{Substs, Kind};
2020
use rustc::ty::layout::VariantIdx;
2121
use rustc::hir::{self, PatKind, RangeEnd};
@@ -60,12 +60,12 @@ pub struct Pattern<'tcx> {
6060

6161
#[derive(Clone, Debug)]
6262
pub struct PatternTypeProjection<'tcx> {
63-
pub base: CanonicalUserTypeAnnotation<'tcx>,
63+
pub base: CanonicalUserType<'tcx>,
6464
pub projs: Vec<ProjectionElem<'tcx, (), ()>>,
6565
}
6666

6767
impl<'tcx> PatternTypeProjection<'tcx> {
68-
pub(crate) fn from_user_type(user_annotation: CanonicalUserTypeAnnotation<'tcx>) -> Self {
68+
pub(crate) fn from_user_type(user_annotation: CanonicalUserType<'tcx>) -> Self {
6969
Self {
7070
base: user_annotation,
7171
projs: Vec::new(),

src/librustc_mir/hair/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc::hir;
2-
use rustc::ty::{self, CanonicalUserTypeAnnotation, TyCtxt, UserType};
2+
use rustc::ty::{self, CanonicalUserType, TyCtxt, UserType};
33

44
crate trait UserAnnotatedTyHelpers<'gcx: 'tcx, 'tcx> {
55
fn tcx(&self) -> TyCtxt<'_, 'gcx, 'tcx>;
@@ -12,7 +12,7 @@ crate trait UserAnnotatedTyHelpers<'gcx: 'tcx, 'tcx> {
1212
fn user_substs_applied_to_ty_of_hir_id(
1313
&self,
1414
hir_id: hir::HirId,
15-
) -> Option<CanonicalUserTypeAnnotation<'tcx>> {
15+
) -> Option<CanonicalUserType<'tcx>> {
1616
let user_provided_types = self.tables().user_provided_types();
1717
let mut user_ty = *user_provided_types.get(hir_id)?;
1818
debug!("user_subts_applied_to_ty_of_hir_id: user_ty={:?}", user_ty);

src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ use rustc::middle::region;
103103
use rustc::mir::interpret::{ConstValue, GlobalId};
104104
use rustc::traits::{self, ObligationCause, ObligationCauseCode, TraitEngine};
105105
use rustc::ty::{
106-
self, AdtKind, CanonicalUserTypeAnnotation, Ty, TyCtxt, GenericParamDefKind, Visibility,
106+
self, AdtKind, CanonicalUserType, Ty, TyCtxt, GenericParamDefKind, Visibility,
107107
ToPolyTraitRef, ToPredicate, RegionKind, UserType
108108
};
109109
use rustc::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase, AutoBorrow, AutoBorrowMutability};
@@ -2252,7 +2252,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
22522252
pub fn write_user_type_annotation(
22532253
&self,
22542254
hir_id: hir::HirId,
2255-
canonical_user_type_annotation: CanonicalUserTypeAnnotation<'tcx>,
2255+
canonical_user_type_annotation: CanonicalUserType<'tcx>,
22562256
) {
22572257
debug!(
22582258
"write_user_type_annotation: hir_id={:?} canonical_user_type_annotation={:?} tag={}",

0 commit comments

Comments
 (0)