Skip to content

Migrate built-in macros pattern_type & view_type to macros 2.0 that expand to internal syntax - #165487

Open
fmease wants to merge 3 commits into
rust-lang:mainfrom
fmease:built-in-macro-to-internal-syntax
Open

fmease wants to merge 3 commits into
rust-lang:mainfrom
fmease:built-in-macro-to-internal-syntax

Conversation

@fmease

@fmease fmease commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Part of MCP-approved #110680.

Best reviewed commit by commit. Please see individual commit messages for further details.

Pinging owner of pattern types @oli-obk & owner of view types @scrabsha for visibility.

(No LLM was or will be used by me during the entire creation process of this PR)

@fmease fmease added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Nov 5, 2026
@rustbot

rustbot commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/tools/compiletest

cc @jieyouxu

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

@rustbot

rustbot commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

r? @mati865

rustbot has assigned @mati865.
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 77 candidates
  • Random selection from 19 candidates

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-raw-pointers Area: raw pointers, MaybeUninit, NonNull A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-minicore` A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Nov 5, 2026
@fmease fmease added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label Nov 5, 2026
@rust-log-analyzer

This comment has been minimized.

@fmease
fmease force-pushed the built-in-macro-to-internal-syntax branch from da7d5bf to a02f646 Compare November 5, 2026 13:52
@rustbot

rustbot commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_gcc is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_gcc instead.

cc @antoyo, @GuillaumeGomez

rustc_codegen_cranelift is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_cranelift instead.

cc @bjorn3

@rust-log-analyzer

This comment has been minimized.

@fmease
fmease force-pushed the built-in-macro-to-internal-syntax branch from a02f646 to 9b599a1 Compare November 5, 2026 14:36
@rust-log-analyzer

This comment has been minimized.

@fmease
fmease force-pushed the built-in-macro-to-internal-syntax branch from 9b599a1 to ca6cb90 Compare November 5, 2026 15:39
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 5, 2026
…ition, r=jieyouxu

compiletest: Fix the edition of minicore to the latest stable one

...instead of using whatever edition the dependent / the reverse dependency is using (!).

Context: rust-lang#165479 (comment).

Unblocks PR rust-lang#165487.

r? @jieyouxu (no rush)

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
@rust-log-analyzer

This comment has been minimized.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 5, 2026
…ition, r=jieyouxu

compiletest: Fix the edition of minicore to the latest stable one

...instead of using whatever edition the dependent / the reverse dependency is using (!).

Context: rust-lang#165479 (comment).

Unblocks PR rust-lang#165487.

r? @jieyouxu (no rush)

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 5, 2026
…ition, r=jieyouxu

compiletest: Fix the edition of minicore to the latest stable one

...instead of using whatever edition the dependent / the reverse dependency is using (!).

Context: rust-lang#165479 (comment).

Unblocks PR rust-lang#165487.

r? @jieyouxu (no rush)

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
@fmease
fmease force-pushed the built-in-macro-to-internal-syntax branch from ca6cb90 to 7a164f7 Compare November 5, 2026 17:03
rust-bors Bot pushed a commit that referenced this pull request Nov 5, 2026
Rollup merge of #165483 - fmease:comptest-fixate-minicore-edition, r=jieyouxu

compiletest: Fix the edition of minicore to the latest stable one

...instead of using whatever edition the dependent / the reverse dependency is using (!).

Context: #165479 (comment).

Unblocks PR #165487.

r? @jieyouxu (no rush)

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
@fmease
fmease force-pushed the built-in-macro-to-internal-syntax branch from 7a164f7 to 8f7bf49 Compare November 5, 2026 19:35
@rustbot

rustbot commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@fmease fmease changed the title [STACKED] Migrate built-in macros pattern_type & view_type to macros 2.0 that expand to internal syntax Migrate built-in macros pattern_type & view_type to macros 2.0 that expand to internal syntax Nov 5, 2026
@fmease fmease removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Nov 5, 2026
Just because the parser of a specific syntax fragment kind returns an
`Err(_)` doesn't automatically mean that the problematic token sequence
isn't "of" that fragment's kind. The token sequence might "almost" be of
that kind (i.e., share a non-empty prefix) but simply contain a syntax
error in it.

On a side note, it's rather odd that the now removed
`annotate_err_with_kind` only added the note "this macro call doesn't
expand to a $fragkind" if the target fragment kind was *type* or *pat*,
there are 20 kinds at the of writing.
…..)`

This also means that it's now available under `core::pat` instead of
`core` directly. This makes it consistent with the `std` re-export
which is only available under `std::pat` and not under `std` directly.

Moreover, drop library feature `pattern_type_macro` and demote language
feature `pattern_types` to a library feature. This is nice because it
means `std::pat::pattern_type` is no longer unnecessarily gated behind
two (!) feature gates.
This also means that it's now available under `core::view` instead of
`core` directly. This makes it consistent with the `std` re-export
which is only available under `std::view` and not under `std` directly.

Moreover, drop library feature `view_type_macro` and demote language
feature `view_types` to a library feature. This is nice because it
means `std::view::view_type` is no longer unnecessarily gated behind
two (!) feature gates.

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

Labels

A-compiletest Area: The compiletest test runner A-raw-pointers Area: raw pointers, MaybeUninit, NonNull A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-minicore` A-testsuite Area: The testsuite used to check the correctness of rustc C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants