Skip to content

Commit e610ddf

Browse files
committed
box a bunch of large types
1 parent ff7636d commit e610ddf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clippy_lints/src/redundant_static_lifetimes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ impl EarlyLintPass for RedundantStaticLifetimes {
100100
}
101101

102102
if !item.span.from_expansion() {
103-
if let ItemKind::Const(ConstItem { ty: ref var_type, .. }) = item.kind {
103+
if let ItemKind::Const(box ConstItem { ty: ref var_type, .. }) = item.kind {
104104
Self::visit_type(var_type, cx, "constants have by default a `'static` lifetime");
105105
// Don't check associated consts because `'static` cannot be elided on those (issue
106106
// #2438)
107107
}
108108

109-
if let ItemKind::Static(Static{ ty: ref var_type,.. }) = item.kind {
109+
if let ItemKind::Static(box Static { ty: ref var_type,.. }) = item.kind {
110110
Self::visit_type(var_type, cx, "statics have by default a `'static` lifetime");
111111
}
112112
}

clippy_utils/src/ast_utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
286286
match (l, r) {
287287
(ExternCrate(l), ExternCrate(r)) => l == r,
288288
(Use(l), Use(r)) => eq_use_tree(l, r),
289-
(Static(ast::Static{ ty: lt, mutability: lm, expr: le}), Static(ast::Static { ty: rt, mutability: rm, expr: re})) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re),
290-
(Const(ast::ConstItem { defaultness: ld, ty: lt, expr: le}), Const(ast::ConstItem { defaultness: rd, ty: rt, expr: re} )) => eq_defaultness(*ld, *rd) && eq_ty(lt, rt) && eq_expr_opt(le, re),
289+
(Static(box ast::Static{ ty: lt, mutability: lm, expr: le}), Static(box ast::Static { ty: rt, mutability: rm, expr: re})) => lm == rm && eq_ty(lt, rt) && eq_expr_opt(le, re),
290+
(Const(box ast::ConstItem { defaultness: ld, ty: lt, expr: le}), Const(box ast::ConstItem { defaultness: rd, ty: rt, expr: re} )) => eq_defaultness(*ld, *rd) && eq_ty(lt, rt) && eq_expr_opt(le, re),
291291
(
292292
Fn(box ast::Fn {
293293
defaultness: ld,
@@ -451,7 +451,7 @@ pub fn eq_foreign_item_kind(l: &ForeignItemKind, r: &ForeignItemKind) -> bool {
451451
pub fn eq_assoc_item_kind(l: &AssocItemKind, r: &AssocItemKind) -> bool {
452452
use AssocItemKind::*;
453453
match (l, r) {
454-
(Const(ast::ConstItem { defaultness: ld, ty: lt, expr: le}), Const(ast::ConstItem { defaultness: rd, ty: rt, expr: re})) => eq_defaultness(*ld, *rd) && eq_ty(lt, rt) && eq_expr_opt(le, re),
454+
(Const(box ast::ConstItem { defaultness: ld, ty: lt, expr: le}), Const(box ast::ConstItem { defaultness: rd, ty: rt, expr: re})) => eq_defaultness(*ld, *rd) && eq_ty(lt, rt) && eq_expr_opt(le, re),
455455
(
456456
Fn(box ast::Fn {
457457
defaultness: ld,

0 commit comments

Comments
 (0)