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>
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 10, 2026
…syntax, r=mati865

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

Part of MCP-approved rust-lang#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.

<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 10, 2026
…syntax, r=mati865

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

Part of MCP-approved rust-lang#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.

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #165575 (Upgrade bundled musl to 1.2.6)
 - #163992 (add `core::arch::{x86, x86_64}::x87_f80`)
 - #165117 (std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims)
 - #165458 (fix incorrect byte count suffix on MSVC)
 - #165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`)
 - #165586 (Remove `backend_optimization_level`.)
 - #165646 (fix NumScalableVectors::from_field_count)
 - #165655 (Unignore passing GCC backend tests)
 - #165740 (miri subtree update)
 - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks)
 - #165682 (interpret: ensure newly created unions have uninit in their padding)
 - #165693 (Move `check_attr` to attribute parsing)
 - #165715 (windows: check for null before wide encoding)
 - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish)
 - #165733 (docs(num): remove needless whitespaces)

Failed merges:

 - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test)
 - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`)
 - #164218 (Tweak private re-export errors to point at correct span and have more context)
 - #165709 (remove 'x miri' smoke test from PR CI)
@JonathanBrouwer

Copy link
Copy Markdown
Member

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #165747 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 10, 2026
@rust-bors

rust-bors Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#165747), which was unapproved.

View changes since this unapproval

@rust-bors

This comment has been minimized.

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.
@fmease
fmease force-pushed the built-in-macro-to-internal-syntax branch from 8f7bf49 to d965694 Compare November 11, 2026 16:20
@rustbot

rustbot commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

The run-make-support library was changed

cc @jieyouxu

@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Nov 11, 2026
@rustbot

rustbot commented Nov 11, 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 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

Just had to update the run-make support library to make it build minicore with Rust 2024.

@bors r=mati865 force

@rust-bors

rust-bors Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit d965694 has been approved by mati865

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 11, 2026
…..)`

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.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 11, 2026
…syntax, r=mati865

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

Part of MCP-approved rust-lang#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.

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #165804 (cg_llvm: Use an invariant lifetime brand for LLVM values)
 - #165412 (Implement `core::ops::FnAddr`)
 - #165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - #165818 (do not lint `redundant_lifetimes` on items from external macros)
 - #164795 (Extend support of lint `explicit_outlives_requirements` to checked type aliases)
 - #165824 (Add regression test for HRTB projection bound with TryFrom error)
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 12, 2026
…syntax, r=mati865

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

Part of MCP-approved rust-lang#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.

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
Rollup of 12 pull requests

Successful merges:

 - #165804 (cg_llvm: Use an invariant lifetime brand for LLVM values)
 - #165778 (Bump stage0 to 1.101.0-beta.1)
 - #165412 (Implement `core::ops::FnAddr`)
 - #165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - #165818 (do not lint `redundant_lifetimes` on items from external macros)
 - #163077 (feat: support nested functions with `#[offload_kernel]`)
 - #164795 (Extend support of lint `explicit_outlives_requirements` to checked type aliases)
 - #165578 (Avoid `Hash::hash` when stable-hashing various types)
 - #165729 (tests: Add regression test for infinite recursive dereference)
 - #165819 (Avoid redundant scans when extracting stage0 archives)
 - #165822 (Remove unused compiler modules and types)
 - #165824 (Add regression test for HRTB projection bound with TryFrom error)
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 12, 2026
…syntax, r=mati865

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

Part of MCP-approved rust-lang#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.

<sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
Rollup of 11 pull requests

Successful merges:

 - #165804 (cg_llvm: Use an invariant lifetime brand for LLVM values)
 - #165778 (Bump stage0 to 1.101.0-beta.1)
 - #165412 (Implement `core::ops::FnAddr`)
 - #165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - #165818 (do not lint `redundant_lifetimes` on items from external macros)
 - #163077 (feat: support nested functions with `#[offload_kernel]`)
 - #164795 (Extend support of lint `explicit_outlives_requirements` to checked type aliases)
 - #165578 (Avoid `Hash::hash` when stable-hashing various types)
 - #165729 (tests: Add regression test for infinite recursive dereference)
 - #165822 (Remove unused compiler modules and types)
 - #165824 (Add regression test for HRTB projection bound with TryFrom error)

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-run-make Area: port run-make Makefiles to rmake.rs 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants