close
Skip to content

remove box_patterns#156749

Open
cyrgani wants to merge 2 commits into
rust-lang:mainfrom
cyrgani:unbox-full
Open

remove box_patterns#156749
cyrgani wants to merge 2 commits into
rust-lang:mainfrom
cyrgani:unbox-full

Conversation

@cyrgani
Copy link
Copy Markdown
Contributor

@cyrgani cyrgani commented May 19, 2026

This PR removes the old feature box_patterns, tracked in #29641. As explained in #29641 (comment), this feature will not be stabilized since deref_patterns (#87121) is a better and more general version of this feature.

It was not possible to remove this feature until recently since the compiler itself still depended on this feature. This was changed with rust-lang/compiler-team#984.

This PR currently breaks crates that rely on box patterns using the incorrect pre-expansion feature gating (see #154045 for more details). Therefore, this needs a crater run.

Currently blocked on rust-lang/rust-clippy#17008.
Closes #29641.
Closes #105099.
Closes #156110.

@cyrgani cyrgani added S-blocked Status: Blocked on something else such as an RFC or other implementation work. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. I-lang-nominated Nominated for discussion during a lang team meeting. needs-crater This change needs a crater run to check for possible breakage in the ecosystem. labels May 19, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 19, 2026

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

The Rustfmt subtree was changed

cc @rust-lang/rustfmt

The Clippy subtree was changed

cc @rust-lang/clippy

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels May 19, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 19, 2026

r? @Kivooeo

rustbot has assigned @Kivooeo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 20 candidates

@cyrgani cyrgani changed the title remove box_patterrns remove box_patterns May 19, 2026
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job pr-check-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:160:24
    |
160 |               MethodCall(box ast::MethodCall {
    |  ________________________^
161 | |                 seg: ls,
162 | |                 receiver: lr,
163 | |                 args: la,
164 | |                 ..
165 | |             }),
    | |_____________^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:166:24
    |
166 |               MethodCall(box ast::MethodCall {
    |  ________________________^
167 | |                 seg: rs,
168 | |                 receiver: rr,
169 | |                 args: ra,
170 | |                 ..
171 | |             }),
    | |_____________^

error: `box_patterns` have been removed
---
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:389:16
    |
389 |               Fn(box ast::Fn {
    |  ________________^
390 | |                 defaultness: rd,
391 | |                 sig: rf,
392 | |                 ident: ri,
...   |
397 | |                 eii_impls: _,
398 | |             }),
    | |_____________^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:423:21
    |
423 |               TyAlias(box ast::TyAlias {
    |  _____________________^
424 | |                 defaultness: ld,
425 | |                 generics: lg,
426 | |                 bounds: lb,
427 | |                 ty: lt,
428 | |                 ..
429 | |             }),
    | |_____________^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:430:21
    |
430 |               TyAlias(box ast::TyAlias {
    |  _____________________^
431 | |                 defaultness: rd,
432 | |                 generics: rg,
433 | |                 bounds: rb,
434 | |                 ty: rt,
---
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:460:19
    |
460 |               Trait(box ast::Trait {
    |  ___________________^
461 | |                 impl_restriction: riprt,
462 | |                 constness: rc,
463 | |                 is_auto: ra,
...   |
468 | |                 items: ris,
469 | |             }),
    | |_____________^

---
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:568:16
    |
568 |               Fn(box ast::Fn {
    |  ________________^
569 | |                 defaultness: rd,
570 | |                 sig: rf,
571 | |                 ident: ri,
...   |
576 | |                 eii_impls: _,
577 | |             }),
    | |_____________^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:587:21
    |
587 |               TyAlias(box ast::TyAlias {
    |  _____________________^
588 | |                 defaultness: ld,
589 | |                 ident: li,
590 | |                 generics: lg,
...   |
593 | |                 ty: lt,
594 | |             }),
    | |_____________^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:595:21
    |
595 |               TyAlias(box ast::TyAlias {
    |  _____________________^
596 | |                 defaultness: rd,
597 | |                 ident: ri,
598 | |                 generics: rg,
...   |
---
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:654:16
    |
654 |               Fn(box ast::Fn {
    |  ________________^
655 | |                 defaultness: rd,
656 | |                 sig: rf,
657 | |                 ident: ri,
...   |
662 | |                 eii_impls: _,
663 | |             }),
    | |_____________^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:673:18
    |
673 |               Type(box TyAlias {
    |  __________________^
674 | |                 defaultness: ld,
675 | |                 ident: li,
676 | |                 generics: lg,
...   |
679 | |                 ty: lt,
680 | |             }),
    | |_____________^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:681:18
    |
681 |               Type(box TyAlias {
    |  __________________^
682 | |                 defaultness: rd,
683 | |                 ident: ri,
684 | |                 generics: rg,
...   |
---
    Checking toml_edit v0.19.15
error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/mir/mod.rs:186:42
    |
186 |             if let StatementKind::Assign(box (place, _)) = statement.kind {
    |                                          ^^^^^^^^^^^^^^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/mir/possible_borrower.rs:160:21
    |
160 |         BinaryOp(_, box (lhs, rhs)) => {
    |                     ^^^^^^^^^^^^^^

[RUSTC-TIMING] zerovec test:false 1.008
    Checking tinystr v0.8.3
error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:193:29
    |
193 |         Rvalue::BinaryOp(_, box (lhs, rhs)) => {
    |                             ^^^^^^^^^^^^^^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:232:31
    |
232 |         StatementKind::Assign(box (place, rval)) => {
    |                               ^^^^^^^^^^^^^^^^^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:237:33
    |
237 |         StatementKind::FakeRead(box (_, place)) => check_place(cx, *place, span, body, msrv),
    |                                 ^^^^^^^^^^^^^^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:241:34
    |
241 |         StatementKind::Intrinsic(box NonDivergingIntrinsic::Assume(op)) => check_operand(cx, op, span, body, msrv),
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: `box_patterns` have been removed
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:243:34
    |
243 |           StatementKind::Intrinsic(box NonDivergingIntrinsic::CopyNonOverlapping(
    |  __________________________________^
244 | |             rustc_middle::mir::CopyNonOverlapping { dst, src, count },
245 | |         )) => {
    | |_________^

---
   Compiling thiserror-impl v1.0.69
error[E0425]: cannot find value `ls` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:172:26
    |
172 |         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
    |                          ^^
    |
help: a local variable with a similar name exists
    |
172 -         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
172 +         ) => eq_path_seg(l, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
    |

error[E0425]: cannot find value `rs` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:172:30
    |
172 |         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
    |                              ^^
    |
help: a local variable with a similar name exists
    |
172 -         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
172 +         ) => eq_path_seg(ls, r) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
    |

error[E0425]: cannot find value `lr` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:172:45
    |
172 |         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
    |                                             ^^
    |
help: a local variable with a similar name exists
    |
172 -         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
172 +         ) => eq_path_seg(ls, rs) && eq_expr(l, rr) && over(la, ra, |l, r| eq_expr(l, r)),
    |
help: consider importing one of these constants
    |
  7 + use crate::sym::lr;
    |
  7 + use rustc_span::sym::lr;
    |

error[E0425]: cannot find value `rr` in this scope
    --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:172:49
     |
 172 |         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
     |                                                 ^^
     |
    ::: compiler/rustc_ast/src/ast.rs:1920:5
     |
1920 |     Err(ErrorGuaranteed),
     |     --- similarly named tuple variant `Err` defined here
     |
help: a tuple variant with a similar name exists
     |
 172 |         ) => eq_path_seg(ls, rs) && eq_expr(lr, Err) && over(la, ra, |l, r| eq_expr(l, r)),
     |                                                 +

error[E0425]: cannot find value `la` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:172:61
    |
172 |         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
    |                                                             ^^
    |
help: a local variable with a similar name exists
    |
172 -         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
172 +         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(l, ra, |l, r| eq_expr(l, r)),
    |

error[E0425]: cannot find value `ra` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:172:65
    |
172 |         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
    |                                                                 ^^
    |
help: a local variable with a similar name exists
    |
172 -         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)),
172 +         ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, r, |l, r| eq_expr(l, r)),
    |

error[E0425]: cannot find value `lb` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:235:31
    |
235 |             eq_closure_binder(lb, rb)
    |                               ^^
    |
help: a local variable with a similar name exists
    |
235 -             eq_closure_binder(lb, rb)
235 +             eq_closure_binder(l, rb)
    |

error[E0425]: cannot find value `rb` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:235:35
    |
235 |             eq_closure_binder(lb, rb)
    |                                   ^^
    |
help: a local variable with a similar name exists
    |
235 -             eq_closure_binder(lb, rb)
235 +             eq_closure_binder(lb, r)
    |

error[E0425]: cannot find value `lc` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:236:20
    |
236 |                 && lc == rc
    |                    ^^
    |
help: a local variable with a similar name exists
    |
236 -                 && lc == rc
236 +                 && l == rc
    |

error[E0425]: cannot find value `rc` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:236:26
    |
236 |                 && lc == rc
    |                          ^^
    |
help: a local variable with a similar name exists
    |
236 -                 && lc == rc
236 +                 && lc == r
    |

error[E0425]: cannot find value `la` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:237:39
    |
237 |                 && eq_coroutine_kind(*la, *ra)
    |                                       ^^
    |
help: a local variable with a similar name exists
    |
237 -                 && eq_coroutine_kind(*la, *ra)
237 +                 && eq_coroutine_kind(*l, *ra)
    |

error[E0425]: cannot find value `ra` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:237:44
    |
237 |                 && eq_coroutine_kind(*la, *ra)
    |                                            ^^
    |
help: a local variable with a similar name exists
    |
237 -                 && eq_coroutine_kind(*la, *ra)
237 +                 && eq_coroutine_kind(*la, *r)
    |

error[E0425]: cannot find value `lm` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:238:20
    |
238 |                 && lm == rm
    |                    ^^
    |
help: a local variable with a similar name exists
    |
238 -                 && lm == rm
238 +                 && l == rm
    |

error[E0425]: cannot find value `rm` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:238:26
    |
238 |                 && lm == rm
    |                          ^^
    |
help: a local variable with a similar name exists
    |
238 -                 && lm == rm
238 +                 && lm == r
    |

error[E0425]: cannot find value `lf` in this scope
    --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:239:31
     |
 239 |                 && eq_fn_decl(lf, rf)
     |                               ^^
     |
    ::: compiler/rustc_ast/src/ast.rs:1781:5
     |
1781 |     If(Box<Expr>, Box<Block>, Option<Box<Expr>>),
     |     -- similarly named tuple variant `If` defined here
     |
help: a tuple variant with a similar name exists
     |
 239 -                 && eq_fn_decl(lf, rf)
 239 +                 && eq_fn_decl(If, rf)
     |

error[E0425]: cannot find value `rf` in this scope
    --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:239:35
     |
 239 |                 && eq_fn_decl(lf, rf)
     |                                   ^^
     |
    ::: compiler/rustc_ast/src/ast.rs:1781:5
     |
1781 |     If(Box<Expr>, Box<Block>, Option<Box<Expr>>),
     |     -- similarly named tuple variant `If` defined here
     |
help: a tuple variant with a similar name exists
     |
 239 -                 && eq_fn_decl(lf, rf)
 239 +                 && eq_fn_decl(lf, If)
     |

error[E0425]: cannot find value `le` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:240:28
    |
240 |                 && eq_expr(le, re)
    |                            ^^
    |
help: a local variable with a similar name exists
    |
240 -                 && eq_expr(le, re)
240 +                 && eq_expr(l, re)
    |
help: consider importing one of these constants
    |
  7 + use crate::sym::le;
    |
  7 + use rustc_span::sym::le;
    |

error[E0425]: cannot find value `re` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:240:32
    |
240 |                 && eq_expr(le, re)
    |                                ^^
    |
help: a local variable with a similar name exists
    |
240 -                 && eq_expr(le, re)
240 +                 && eq_expr(le, r)
    |

error[E0425]: cannot find value `li` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:353:21
    |
353 |         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |                     ^^
    |
help: a local variable with a similar name exists
    |
353 -         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
353 +         ) => eq_id(*l, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |

error[E0425]: cannot find value `ri` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:353:26
    |
353 |         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |                          ^^
    |
help: a local variable with a similar name exists
    |
353 -         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
353 +         ) => eq_id(*li, *r) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |

error[E0425]: cannot find value `lm` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:353:33
    |
353 |         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |                                 ^^
    |
help: a local variable with a similar name exists
    |
353 -         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
353 +         ) => eq_id(*li, *ri) && l == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |

error[E0425]: cannot find value `rm` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:353:39
    |
353 |         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |                                       ^^
    |
help: a local variable with a similar name exists
    |
353 -         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
353 +         ) => eq_id(*li, *ri) && lm == r && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |

error[E0425]: cannot find value `ls` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:353:45
    |
353 |         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |                                             ^^
    |
help: a local variable with a similar name exists
    |
353 -         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
353 +         ) => eq_id(*li, *ri) && lm == rm && l == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |

error[E0425]: cannot find value `rs` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:353:51
    |
353 |         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |                                                   ^^
    |
help: a local variable with a similar name exists
    |
353 -         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
353 +         ) => eq_id(*li, *ri) && lm == rm && ls == r && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |

error[E0425]: cannot find value `lt` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:353:63
    |
353 |         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |                                                               ^^
    |
help: a local variable with a similar name exists
    |
353 -         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
353 +         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(l, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |
help: consider importing one of these constants
    |
  7 + use crate::sym::lt;
    |
  7 + use rustc_span::sym::lt;
    |

error[E0425]: cannot find value `rt` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:353:67
    |
353 |         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |                                                                   ^^
    |
help: a local variable with a similar name exists
    |
353 -         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
353 +         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, r) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |

error[E0425]: cannot find value `le` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:353:86
    |
353 |         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |                                                                                      ^^
    |
help: a local variable with a similar name exists
    |
353 -         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
353 +         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(l.as_deref(), re.as_deref()),
    |
help: consider importing one of these constants
    |
  7 + use crate::sym::le;
    |
  7 + use rustc_span::sym::le;
    |

error[E0425]: cannot find value `re` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:353:101
    |
353 |         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
    |                                                                                                     ^^
    |
help: a local variable with a similar name exists
    |
353 -         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), re.as_deref()),
353 +         ) => eq_id(*li, *ri) && lm == rm && ls == rs && eq_ty(lt, rt) && eq_expr_opt(le.as_deref(), r.as_deref()),
    |

error[E0425]: cannot find value `ld` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:372:29
    |
372 |             eq_defaultness(*ld, *rd)
    |                             ^^
    |
help: a local variable with a similar name exists
    |
372 -             eq_defaultness(*ld, *rd)
372 +             eq_defaultness(*l, *rd)
    |

error[E0425]: cannot find value `rd` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:372:34
    |
372 |             eq_defaultness(*ld, *rd)
    |                                  ^^
    |
help: a local variable with a similar name exists
    |
372 -             eq_defaultness(*ld, *rd)
372 +             eq_defaultness(*ld, *r)
    |

error[E0425]: cannot find value `li` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:373:27
    |
373 |                 && eq_id(*li, *ri)
    |                           ^^
    |
help: a local variable with a similar name exists
    |
373 -                 && eq_id(*li, *ri)
373 +                 && eq_id(*l, *ri)
    |

error[E0425]: cannot find value `ri` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:373:32
    |
373 |                 && eq_id(*li, *ri)
    |                                ^^
    |
help: a local variable with a similar name exists
    |
373 -                 && eq_id(*li, *ri)
373 +                 && eq_id(*li, *r)
    |

error[E0425]: cannot find value `lg` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:374:32
    |
374 |                 && eq_generics(lg, rg)
    |                                ^^
    |
help: a local variable with a similar name exists
    |
374 -                 && eq_generics(lg, rg)
374 +                 && eq_generics(l, rg)
    |

error[E0425]: cannot find value `rg` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:374:36
    |
374 |                 && eq_generics(lg, rg)
    |                                    ^^
    |
help: a local variable with a similar name exists
    |
374 -                 && eq_generics(lg, rg)
374 +                 && eq_generics(lg, r)
    |

[RUSTC-TIMING] icu_locale_core test:false 1.683
error[E0425]: cannot find value `lt` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:375:26
    |
375 |                 && eq_ty(lt, rt)
    |                          ^^
    |
help: a local variable with a similar name exists
    |
375 -                 && eq_ty(lt, rt)
375 +                 && eq_ty(l, rt)
    |
help: consider importing one of these constants
    |
  7 + use crate::sym::lt;
    |
  7 + use rustc_span::sym::lt;
    |

error[E0425]: cannot find value `rt` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:375:30
    |
375 |                 && eq_ty(lt, rt)
    |                              ^^
    |
help: a local variable with a similar name exists
    |
375 -                 && eq_ty(lt, rt)
375 +                 && eq_ty(lt, r)
    |

    Checking icu_provider v2.2.0
error[E0425]: cannot find value `lb` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:376:30
    |
376 |                 && both(Some(lb), Some(rb), eq_const_item_rhs)
    |                              ^^
    |
help: a local variable with a similar name exists
    |
376 -                 && both(Some(lb), Some(rb), eq_const_item_rhs)
376 +                 && both(Some(l), Some(rb), eq_const_item_rhs)
    |

error[E0425]: cannot find value `rb` in this scope
   --> src/tools/clippy/clippy_utils/src/ast_utils/mod.rs:376:40
    |
376 |                 && both(Some(lb), Some(rb), eq_const_item_rhs)
    |                                        ^^
    |
help: a local variable with a similar name exists
    |
376 -                 && both(Some(lb), Some(rb), eq_const_item_rhs)
---

error[E0425]: cannot find value `lhs` in this scope
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:194:31
    |
194 |             check_operand(cx, lhs, span, body, msrv)?;
    |                               ^^^ not found in this scope
    |
help: consider importing one of these constants
    |
  6 + use crate::sym::lhs;
    |
  6 + use rustc_span::sym::lhs;
    |

error[E0425]: cannot find value `rhs` in this scope
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:195:31
    |
195 |             check_operand(cx, rhs, span, body, msrv)?;
    |                               ^^^ not found in this scope

error[E0425]: cannot find value `lhs` in this scope
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:196:22
    |
196 |             let ty = lhs.ty(body, cx.tcx);
    |                      ^^^ not found in this scope
    |
help: consider importing one of these constants
    |
  6 + use crate::sym::lhs;
    |
  6 + use rustc_span::sym::lhs;
    |

error[E0425]: cannot find value `place` in this scope
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:233:30
    |
233 |             check_place(cx, *place, span, body, msrv)?;
    |                              ^^^^^ not found in this scope

error[E0425]: cannot find value `rval` in this scope
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:234:44
    |
234 |             check_rvalue(cx, body, def_id, rval, span, msrv)
    |                                            ^^^^ not found in this scope

error[E0425]: cannot find value `place` in this scope
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:237:69
    |
237 |         StatementKind::FakeRead(box (_, place)) => check_place(cx, *place, span, body, msrv),
    |                                                                     ^^^^^ not found in this scope

error[E0425]: cannot find value `op` in this scope
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:241:94
    |
241 |         StatementKind::Intrinsic(box NonDivergingIntrinsic::Assume(op)) => check_operand(cx, op, span, body, msrv),
    |                                                                                              ^^ not found in this scope

error[E0425]: cannot find value `dst` in this scope
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:246:31
    |
246 |             check_operand(cx, dst, span, body, msrv)?;
    |                               ^^^ not found in this scope

error[E0425]: cannot find value `src` in this scope
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:247:31
    |
247 |             check_operand(cx, src, span, body, msrv)?;
    |                               ^^^ not found in this scope

error[E0425]: cannot find value `count` in this scope
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:248:31
    |
248 |             check_operand(cx, count, span, body, msrv)
    |                               ^^^^^ not found in this scope
    |
help: consider importing one of these constants
    |
  6 + use crate::sym::count;

@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented May 19, 2026

Therefore, this needs a crater run

Which one? would check-only be sufficient for this?

}

fn main() {
let a = Box::new(Test::Foo(10));
Copy link
Copy Markdown
Contributor

@jakubadamw jakubadamw May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect the spirit of the original test presumed having a and b boxed, so these should be kept as they were, and instead deref patterns should be used (implicitly or explicitly with deref!)? What do you think?

View changes since the review

@traviscross traviscross added the P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang label May 27, 2026
@tmandry tmandry added the T-lang Relevant to the language team label May 27, 2026
@tmandry
Copy link
Copy Markdown
Member

tmandry commented May 27, 2026

I don't expect the crater breakage to be significant; if it is, we should discuss again.

@rfcbot merge lang

@rust-rfcbot
Copy link
Copy Markdown
Collaborator

rust-rfcbot commented May 27, 2026

Team member @tmandry has proposed to merge this. The next step is review by the rest of the tagged team members:

Concerns:

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels May 27, 2026
@traviscross traviscross added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label May 27, 2026
@traviscross
Copy link
Copy Markdown
Contributor

Looks good to me pending crater results; thanks @cyrgani.

@rfcbot reviewed
@rfcbot concern crater

@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented May 29, 2026

About to run crater. In my opinion check-only should be sufficient for this, do folks have other opinion?

@fmease
Copy link
Copy Markdown
Member

fmease commented May 29, 2026

About to run crater. In my opinion check-only should be sufficient for this, do folks have other opinion?

Yes, it's absolutely sufficient. This PR rejects previously valid code in the frontend of the compiler, it removes syntax. The only things that don't show up in check builds are monomorphization and codegen changes.

IINM one thing which you miss out on in check-only crater runs are potential doctest regressions but that's just something you have to accept if you want to have "faster" crater runs, otherwise craterbot check would never be an option for anyone. In any case, the beta crater runs will run in build-and-test mode and exercise doctests anyway, so we'd still catch such regressions eventually and still have a bit of time to either revert the change or to send (more) downstream patches. Anyway, it's not super likely that anybody is using box patterns in doctests (without also using them in the main crater), I'd say.

@fmease
Copy link
Copy Markdown
Member

fmease commented May 29, 2026

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 29, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 29, 2026

☀️ Try build successful (CI)
Build commit: 1639375 (163937523761cc0def32f1ba9ed63fdf65ad3478, parent: dc375db7d8df0aa450e622c529147c95eee756f5)

@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented May 29, 2026

@craterbot run mode=check-only

@craterbot
Copy link
Copy Markdown
Collaborator

👌 Experiment pr-156749 created and queued.
🤖 Automatically detected try build 1639375
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. I-lang-nominated Nominated for discussion during a lang team meeting. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. needs-crater This change needs a crater run to check for possible breakage in the ecosystem. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. S-waiting-on-crater Status: Waiting on a crater run to be completed. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

10 participants