Skip to content

[rust] Replace removed box patterns with deref patterns - #9536

Open
chenrui333 wants to merge 1 commit into
meta:mainfrom
chenrui333:rust-deref-patterns
Open

chenrui333 wants to merge 1 commit into
meta:mainfrom
chenrui333:rust-deref-patterns

Conversation

@chenrui333

Copy link
Copy Markdown

Summary

Rust 1.100 removed #![feature(box_patterns)] (superseded by deref_patterns), so the Rust port no longer builds with current toolchains:

error[E0557]: feature has been removed
 --> crates/flow_common/src/lib.rs:8:12
  |
8 | #![feature(box_patterns)]
  |            ^^^^^^^^^^^^ feature has been removed
  |
  = note: removed in 1.100.0
  = note: superseded by `deref_patterns`

This rewrites every box PAT pattern to deref!(PAT) and enables deref_patterns in place of box_patterns. deref! keeps the original binding semantics (including box x @ Pat), so no other code changes are needed. The change is mechanical and contains no formatting changes.

Test plan

With Rust 1.100.0 and RUSTC_BOOTSTRAP=1, in rust_port:

  • cargo build succeeds
  • cargo test --no-fail-fast: 2565 passed, 0 failed (RUST_MIN_STACK raised; flow_parser tests overflow the default debug stack independently of this change)

Homebrew packages Flow with stable Rust and currently cannot build v0.342.0 because of this.

`box_patterns` was removed in Rust 1.100 and superseded by `deref_patterns`, so the Rust port no longer builds with current toolchains:

    error[E0557]: feature has been removed
     --> crates/flow_common/src/lib.rs:8:12
      |
    8 | #![feature(box_patterns)]
      |            ^^^^^^^^^^^^ feature has been removed

Rewrite every `box PAT` pattern to the equivalent `deref!(PAT)` and enable
`deref_patterns` instead of `box_patterns`. `deref!` keeps the original
binding semantics, including `box x @ Pat` bindings, so no other code changes
are needed. The rewrite is mechanical; no formatting changes are included.

Signed-off-by: Rui Chen <rui@chenrui.dev>
@meta-cla meta-cla Bot added the CLA Signed label Nov 23, 2026
@meta-codesync

meta-codesync Bot commented Nov 23, 2026

Copy link
Copy Markdown

This pull request has been imported. If you are a Meta employee, you can view this in D133920884. (Because this pull request was imported automatically, there will not be any future comments.)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant