Rename CanonicalUserTypeAnnotation -> CanonicalUserType
We want the name `CanonicalUserTypeAnnotation` for our own use.
This commit is contained in:
parent
ab7bc3a23d
commit
5ca6bd50b5
6 changed files with 15 additions and 15 deletions
|
@ -350,7 +350,7 @@ pub struct TypeckTables<'tcx> {
|
|||
/// canonical substitutions would include only `for<X> { Vec<X> }`.
|
||||
///
|
||||
/// See also `AscribeUserType` statement in MIR.
|
||||
user_provided_types: ItemLocalMap<CanonicalUserTypeAnnotation<'tcx>>,
|
||||
user_provided_types: ItemLocalMap<CanonicalUserType<'tcx>>,
|
||||
|
||||
/// 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<UserTypeAnnotationIndex, (Span, CanonicalUserTypeAnnotation<'tcx>)>;
|
||||
IndexVec<UserTypeAnnotationIndex, (Span, CanonicalUserType<'tcx>)>;
|
||||
|
||||
/// 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 {
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
@ -797,7 +797,7 @@ fn user_substs_applied_to_def(
|
|||
cx: &mut Cx<'a, 'gcx, 'tcx>,
|
||||
hir_id: hir::HirId,
|
||||
def: &Def,
|
||||
) -> Option<ty::CanonicalUserTypeAnnotation<'tcx>> {
|
||||
) -> Option<ty::CanonicalUserType<'tcx>> {
|
||||
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
|
||||
|
|
|
@ -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<ProjectionElem<'tcx, (), ()>>,
|
||||
}
|
||||
|
||||
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(),
|
||||
|
|
|
@ -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<CanonicalUserTypeAnnotation<'tcx>> {
|
||||
) -> Option<CanonicalUserType<'tcx>> {
|
||||
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);
|
||||
|
|
|
@ -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={}",
|
||||
|
|
Loading…
Reference in a new issue