Skip to content

Commit a0d03a2

Browse files
committed
Remove boxes from ast TyPat lists
1 parent dc26336 commit a0d03a2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2537,7 +2537,7 @@ pub enum TyPatKind {
25372537
/// A range pattern (e.g., `1...2`, `1..2`, `1..`, `..2`, `1..=2`, `..=2`).
25382538
Range(Option<Box<AnonConst>>, Option<Box<AnonConst>>, Spanned<RangeEnd>),
25392539

2540-
Or(ThinVec<Box<TyPat>>),
2540+
Or(ThinVec<TyPat>),
25412541

25422542
/// Placeholder for a pattern that wasn't syntactically well formed in some way.
25432543
Err(ErrorGuaranteed),

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ macro_rules! common_visitor_and_walkers {
391391
ThinVec<PreciseCapturingArg>,
392392
ThinVec<Pat>,
393393
ThinVec<Ty>,
394-
ThinVec<Box<TyPat>>,
394+
ThinVec<TyPat>,
395395
);
396396

397397
// This macro generates `impl Visitable` and `impl MutVisitable` that forward to `Walkable`

compiler/rustc_builtin_macros/src/pattern_type.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ fn parse_pat_ty<'a>(
4444
parser.unexpected()?;
4545
}
4646

47-
Ok((ty, pat))
47+
Ok((ty, Box::new(pat)))
4848
}
4949

50-
fn ty_pat(kind: TyPatKind, span: Span) -> Box<TyPat> {
51-
Box::new(TyPat { id: DUMMY_NODE_ID, kind, span, tokens: None })
50+
fn ty_pat(kind: TyPatKind, span: Span) -> TyPat {
51+
TyPat { id: DUMMY_NODE_ID, kind, span, tokens: None }
5252
}
5353

54-
fn pat_to_ty_pat(cx: &mut ExtCtxt<'_>, pat: ast::Pat) -> Box<TyPat> {
54+
fn pat_to_ty_pat(cx: &mut ExtCtxt<'_>, pat: ast::Pat) -> TyPat {
5555
let kind = match pat.kind {
5656
ast::PatKind::Range(start, end, include_end) => TyPatKind::Range(
5757
start.map(|value| Box::new(AnonConst { id: DUMMY_NODE_ID, value })),

0 commit comments

Comments
 (0)