Skip to content

Rustup - #5180

Merged
RalfJung merged 6 commits into
rust-lang:masterfrom
RalfJung:rustup
Jul 13, 2026
Merged

Rustup#5180
RalfJung merged 6 commits into
rust-lang:masterfrom
RalfJung:rustup

Conversation

@RalfJung

Copy link
Copy Markdown
Member

Needs some fixes for FreeBSD environ support due to rust-lang/rust#159112.

bors and others added 4 commits July 12, 2026 13:01
Preparatory changes for macro parsing BFS->DFS



This PR contains some miscellaneous commits I accumulated while working on the BFS->DFS change. Their goal is to simplify the code and clarifying existing behavior. It is a conceptual follow-up to rust-lang/rust#158577. High-level overview:

- Adds context about the current match arm to `Tracker` through the new `Tracker::prepare()`, so that the `WhichMatcher` parameter is available implicitly. In a later PR, this will be used to reference `MatcherLoc`s by index.

- Reformulates matching failures to work more like ambiguity errors wrt. `Tracker`; `Tracker::build_failure()` (which would build a failure consumed by `Tracker::after_arm()`) becomes `Tracker::failure()` which eagerly processes the error. This removes the need for `ParseResult::Failure` to store any data at all. This relies on the match arm context provided by `Tracker::prepare()`.

- There is a subtle edge case involving `token::Eof` and non-terminal parsing; `Parser::nonterminal_may_begin_with()` would sometimes return `true` for `token::Eof`, even though the non-terminal parse would never be attempted. `TtParser` did not check `bb_mps` when handling `token::Eof`, so non-terminal parses at EOF were being silently dropped. I changed `Parser::nonterminal_may_begin_with()` to always return `false` for `token::Eof`, making this behavior much more visible. I added a test case to make sure meta-variables return the same error uniformly when parsed against EOF.

Contains rust-lang/rust#158894, which should be merged soon (after which I'll rebase onto `main`).

Best reviewed commit-by-commit.

r? @nnethercote
This updates the rust-version file to 48c2cee70232ecc3a6a8e285b2e15620b39f82a7.
@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Jul 13, 2026
@RalfJung
RalfJung enabled auto-merge July 13, 2026 07:01
@RalfJung
RalfJung added this pull request to the merge queue Jul 13, 2026
Merged via the queue into rust-lang:master with commit 49d042f Jul 13, 2026
14 checks passed
@RalfJung
RalfJung deleted the rustup branch July 13, 2026 10:47
@rustbot rustbot removed the S-waiting-on-review Status: Waiting for a review to complete label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants