Box CanonicalUserTypeAnnotation::CanonicalUserType
.
This shrinks `Ascription`, which shrinks `PatKind::AscribeUserType`, which shrinks `Pat`.
This commit is contained in:
parent
2c4c8eb1a3
commit
a40124e01c
@ -809,8 +809,8 @@ mod size_asserts {
|
||||
static_assert_size!(Block, 56);
|
||||
static_assert_size!(Expr<'_>, 64);
|
||||
static_assert_size!(ExprKind<'_>, 40);
|
||||
static_assert_size!(Pat<'_>, 112);
|
||||
static_assert_size!(PatKind<'_>, 96);
|
||||
static_assert_size!(Pat<'_>, 80);
|
||||
static_assert_size!(PatKind<'_>, 64);
|
||||
static_assert_size!(Stmt<'_>, 56);
|
||||
static_assert_size!(StmtKind<'_>, 48);
|
||||
}
|
||||
|
@ -874,7 +874,7 @@ pub type CanonicalUserTypeAnnotations<'tcx> =
|
||||
|
||||
#[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable, Lift)]
|
||||
pub struct CanonicalUserTypeAnnotation<'tcx> {
|
||||
pub user_ty: CanonicalUserType<'tcx>,
|
||||
pub user_ty: Box<CanonicalUserType<'tcx>>,
|
||||
pub span: Span,
|
||||
pub inferred_ty: Ty<'tcx>,
|
||||
}
|
||||
|
@ -42,10 +42,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
Constant { span, user_ty: None, literal }
|
||||
}
|
||||
ExprKind::NonHirLiteral { lit, ref user_ty } => {
|
||||
let user_ty = user_ty.as_ref().map(|box user_ty| {
|
||||
let user_ty = user_ty.as_ref().map(|user_ty| {
|
||||
this.canonical_user_type_annotations.push(CanonicalUserTypeAnnotation {
|
||||
span,
|
||||
user_ty: *user_ty,
|
||||
user_ty: user_ty.clone(),
|
||||
inferred_ty: ty,
|
||||
})
|
||||
});
|
||||
@ -54,10 +54,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
Constant { span, user_ty: user_ty, literal }
|
||||
}
|
||||
ExprKind::ZstLiteral { ref user_ty } => {
|
||||
let user_ty = user_ty.as_ref().map(|box user_ty| {
|
||||
let user_ty = user_ty.as_ref().map(|user_ty| {
|
||||
this.canonical_user_type_annotations.push(CanonicalUserTypeAnnotation {
|
||||
span,
|
||||
user_ty: *user_ty,
|
||||
user_ty: user_ty.clone(),
|
||||
inferred_ty: ty,
|
||||
})
|
||||
});
|
||||
@ -66,10 +66,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
Constant { span, user_ty: user_ty, literal }
|
||||
}
|
||||
ExprKind::NamedConst { def_id, substs, ref user_ty } => {
|
||||
let user_ty = user_ty.as_ref().map(|box user_ty| {
|
||||
let user_ty = user_ty.as_ref().map(|user_ty| {
|
||||
this.canonical_user_type_annotations.push(CanonicalUserTypeAnnotation {
|
||||
span,
|
||||
user_ty: *user_ty,
|
||||
user_ty: user_ty.clone(),
|
||||
inferred_ty: ty,
|
||||
})
|
||||
});
|
||||
|
@ -522,11 +522,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
fake_borrow_temps,
|
||||
)
|
||||
);
|
||||
if let Some(box user_ty) = user_ty {
|
||||
if let Some(user_ty) = user_ty {
|
||||
let annotation_index =
|
||||
this.canonical_user_type_annotations.push(CanonicalUserTypeAnnotation {
|
||||
span: source_info.span,
|
||||
user_ty: *user_ty,
|
||||
user_ty: user_ty.clone(),
|
||||
inferred_ty: expr.ty,
|
||||
});
|
||||
|
||||
@ -551,11 +551,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
let source = &this.thir[source];
|
||||
let temp =
|
||||
unpack!(block = this.as_temp(block, source.temp_lifetime, source, mutability));
|
||||
if let Some(box user_ty) = user_ty {
|
||||
if let Some(user_ty) = user_ty {
|
||||
let annotation_index =
|
||||
this.canonical_user_type_annotations.push(CanonicalUserTypeAnnotation {
|
||||
span: source_info.span,
|
||||
user_ty: *user_ty,
|
||||
user_ty: user_ty.clone(),
|
||||
inferred_ty: expr.ty,
|
||||
});
|
||||
this.cfg.push(
|
||||
|
@ -378,10 +378,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
};
|
||||
|
||||
let inferred_ty = expr.ty;
|
||||
let user_ty = user_ty.as_ref().map(|box user_ty| {
|
||||
let user_ty = user_ty.as_ref().map(|user_ty| {
|
||||
this.canonical_user_type_annotations.push(CanonicalUserTypeAnnotation {
|
||||
span: source_info.span,
|
||||
user_ty: *user_ty,
|
||||
user_ty: user_ty.clone(),
|
||||
inferred_ty,
|
||||
})
|
||||
});
|
||||
|
@ -87,7 +87,7 @@ impl<'tcx> Cx<'tcx> {
|
||||
{
|
||||
debug!("mirror_stmts: user_ty={:?}", user_ty);
|
||||
let annotation = CanonicalUserTypeAnnotation {
|
||||
user_ty,
|
||||
user_ty: Box::new(user_ty),
|
||||
span: ty.span,
|
||||
inferred_ty: self.typeck_results.node_type(ty.hir_id),
|
||||
};
|
||||
|
@ -443,7 +443,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
|
||||
if let Some(user_ty) = self.user_substs_applied_to_ty_of_hir_id(hir_id) {
|
||||
debug!("lower_variant_or_leaf: kind={:?} user_ty={:?} span={:?}", kind, user_ty, span);
|
||||
let annotation = CanonicalUserTypeAnnotation {
|
||||
user_ty,
|
||||
user_ty: Box::new(user_ty),
|
||||
span,
|
||||
inferred_ty: self.typeck_results.node_type(hir_id),
|
||||
};
|
||||
@ -512,7 +512,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
|
||||
let user_provided_types = self.typeck_results().user_provided_types();
|
||||
if let Some(&user_ty) = user_provided_types.get(id) {
|
||||
let annotation = CanonicalUserTypeAnnotation {
|
||||
user_ty,
|
||||
user_ty: Box::new(user_ty),
|
||||
span,
|
||||
inferred_ty: self.typeck_results().node_type(id),
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user