Repository navigation
[rust] Replace removed box patterns with deref patterns - #9536
Open
chenrui333 wants to merge 1 commit into
Open
chenrui333 wants to merge 1 commit into
chenrui333 wants to merge 1 commit into
Conversation
`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>
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rust 1.100 removed
#, so the Rust port no longer builds with current toolchains:This rewrites every
box PATpattern toderef!(PAT)and enablesderef_patternsin place ofbox_patterns.deref!keeps the original binding semantics (includingbox 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, inrust_port:cargo buildsucceedscargo test --no-fail-fast: 2565 passed, 0 failed (RUST_MIN_STACKraised;flow_parsertests 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.