Skip to content

Commit

Permalink
Rename PatternTypeProjection to PatTyProj
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Sep 26, 2019
1 parent d556193 commit 79ff448
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/librustc_mir/build/matches/mod.rs
Expand Up @@ -708,7 +708,7 @@ struct Binding<'tcx> {
struct Ascription<'tcx> {
span: Span,
source: Place<'tcx>,
user_ty: PatternTypeProjection<'tcx>,
user_ty: PatTyProj<'tcx>,
variance: ty::Variance,
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/hair/cx/block.rs
Expand Up @@ -83,7 +83,7 @@ fn mirror_stmts<'a, 'tcx>(
span: pattern.span,
kind: Box::new(PatKind::AscribeUserType {
ascription: hair::pattern::Ascription {
user_ty: PatternTypeProjection::from_user_type(user_ty),
user_ty: PatTyProj::from_user_type(user_ty),
user_ty_span: ty.span,
variance: ty::Variance::Covariant,
},
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/hair/mod.rs
Expand Up @@ -21,7 +21,7 @@ mod constant;

pub mod pattern;
pub use self::pattern::{BindingMode, Pattern, PatKind, PatRange, FieldPat};
pub(crate) use self::pattern::PatternTypeProjection;
pub(crate) use self::pattern::PatTyProj;

mod util;

Expand Down
12 changes: 6 additions & 6 deletions src/librustc_mir/hair/pattern/mod.rs
Expand Up @@ -62,11 +62,11 @@ pub struct Pattern<'tcx> {


#[derive(Copy, Clone, Debug, PartialEq)]
pub struct PatternTypeProjection<'tcx> {
pub struct PatTyProj<'tcx> {
pub user_ty: CanonicalUserType<'tcx>,
}

impl<'tcx> PatternTypeProjection<'tcx> {
impl<'tcx> PatTyProj<'tcx> {
pub(crate) fn from_user_type(user_annotation: CanonicalUserType<'tcx>) -> Self {
Self {
user_ty: user_annotation,
Expand All @@ -92,7 +92,7 @@ impl<'tcx> PatternTypeProjection<'tcx> {

#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Ascription<'tcx> {
pub user_ty: PatternTypeProjection<'tcx>,
pub user_ty: PatTyProj<'tcx>,
/// Variance to use when relating the type `user_ty` to the **type of the value being
/// matched**. Typically, this is `Variance::Covariant`, since the value being matched must
/// have a type that is some subtype of the ascribed type.
Expand Down Expand Up @@ -831,7 +831,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
kind: Box::new(kind),
},
ascription: Ascription {
user_ty: PatternTypeProjection::from_user_type(user_ty),
user_ty: PatTyProj::from_user_type(user_ty),
user_ty_span: span,
variance: ty::Variance::Covariant,
},
Expand Down Expand Up @@ -878,7 +878,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {

let user_provided_types = self.tables().user_provided_types();
return if let Some(u_ty) = user_provided_types.get(id) {
let user_ty = PatternTypeProjection::from_user_type(*u_ty);
let user_ty = PatTyProj::from_user_type(*u_ty);
Pattern {
span,
kind: Box::new(
Expand Down Expand Up @@ -1358,7 +1358,7 @@ CloneImpls!{ <'tcx>
Span, Field, Mutability, ast::Name, hir::HirId, usize, ty::Const<'tcx>,
Region<'tcx>, Ty<'tcx>, BindingMode, &'tcx AdtDef,
SubstsRef<'tcx>, &'tcx GenericArg<'tcx>, UserType<'tcx>,
UserTypeProjection, PatternTypeProjection<'tcx>
UserTypeProjection, PatTyProj<'tcx>
}

impl<'tcx> PatternFoldable<'tcx> for FieldPat<'tcx> {
Expand Down

0 comments on commit 79ff448

Please sign in to comment.