Skip to content

pattern_type: make print format match the current syntax - #161707

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
GTimothy:pattern_type-pretty-print-impl
Aug 26, 2026
Merged

pattern_type: make print format match the current syntax#161707
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
GTimothy:pattern_type-pretty-print-impl

Conversation

@GTimothy

@GTimothy GTimothy commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Print a pattern type using the pattern_type!(type is pattern) syntax instead of (type) is pattern.

This helps for example when suggesting fixes: (type) is pattern is not valid rust right now but pattern_type!(type is pattern) is.
This is not a bug as pattern_type is not on stable but it is a fairly impact-less change, just a print change.

discussion: #t-compiler > pattern_type pretty format

closes rust-lang/rust-clippy#17613

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 24, 2026
@rustbot

rustbot commented Aug 24, 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, types
  • compiler, types expanded to 75 candidates
  • Random selection from 17 candidates

@rust-log-analyzer

This comment has been minimized.

@GTimothy
GTimothy marked this pull request as draft August 24, 2026 23:24
@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 24, 2026
@GTimothy
GTimothy force-pushed the pattern_type-pretty-print-impl branch from 3905879 to 2cbcaa6 Compare August 25, 2026 09:13
@mati865

mati865 commented Aug 25, 2026

Copy link
Copy Markdown
Member

r? @mejrs

@rustbot rustbot assigned mejrs and unassigned mati865 Aug 25, 2026
@rust-log-analyzer

This comment has been minimized.

@GTimothy
GTimothy force-pushed the pattern_type-pretty-print-impl branch from 2cbcaa6 to 4143d96 Compare August 25, 2026 10:11
Comment thread tests/ui/type/pattern_types/derives_fail.rs Outdated
@GTimothy
GTimothy force-pushed the pattern_type-pretty-print-impl branch from 4143d96 to cace07d Compare August 25, 2026 10:28
@GTimothy
GTimothy marked this pull request as ready for review August 25, 2026 10:31
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 25, 2026
@rust-log-analyzer

This comment has been minimized.

@GTimothy
GTimothy force-pushed the pattern_type-pretty-print-impl branch from cace07d to 2a6be21 Compare August 25, 2026 11:41
@rust-log-analyzer

This comment has been minimized.

@GTimothy
GTimothy marked this pull request as draft August 25, 2026 14:01
@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 25, 2026
@GTimothy
GTimothy force-pushed the pattern_type-pretty-print-impl branch from 2a6be21 to 035eea7 Compare August 25, 2026 14:51
@rust-log-analyzer

This comment has been minimized.

@GTimothy
GTimothy force-pushed the pattern_type-pretty-print-impl branch 2 times, most recently from f958f7d to d812ce0 Compare August 25, 2026 15:55
@rust-log-analyzer

This comment has been minimized.

@GTimothy
GTimothy force-pushed the pattern_type-pretty-print-impl branch from d812ce0 to 58f5ecf Compare August 25, 2026 21:38
@GTimothy
GTimothy marked this pull request as ready for review August 26, 2026 08:35
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 26, 2026
@rustbot

rustbot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

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

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 26, 2026
@GTimothy

Copy link
Copy Markdown
Contributor Author

I did not expect that there would be so many tests expecting this format 😅

Also, I don't think I can split the miri part, because then the tests will fail, in both PRs.

@RalfJung

Copy link
Copy Markdown
Member

Print a pattern type using the pattern_type!(type as pattern) syntax instead of (type) as pattern.

Those as should be is I think.

@mejrs mejrs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors

rust-bors Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 58f5ecf has been approved by mejrs

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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 26, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 26, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #161433 (Overhaul `rustc_middle::query`)
 - #158370 (rewrite never type documentation)
 - #160354 (update `ambiguous_glob_imported_trait` lint explanation and example.)
 - #161447 (Construct paramenvs from an iterator)
 - #161707 (pattern_type: make print format match the current syntax)
 - #161773 (Update WASI targets to wasi-sdk-34)
 - #161807 (bootstrap: skip StdarchVerify when remote testing is enabled)
@rust-bors
rust-bors Bot merged commit 0a31c0f into rust-lang:main Aug 26, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 26, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 26, 2026
Rollup merge of #161707 - GTimothy:pattern_type-pretty-print-impl, r=mejrs

pattern_type: make print format match the current syntax

Print a pattern type using the `pattern_type!(type is pattern)` syntax instead of `(type) is pattern`.

This helps for example when suggesting fixes:  `(type) is pattern` is not valid rust right now but  `pattern_type!(type is pattern)` is.
This is not a bug as `pattern_type` is not on stable but it is a fairly impact-less change, just a print change.

discussion: [#t-compiler > pattern_type pretty format](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/pattern_type.20pretty.20format/with/618658793)

closes rust-lang/rust-clippy#17613
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Aug 27, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#161433 (Overhaul `rustc_middle::query`)
 - rust-lang/rust#158370 (rewrite never type documentation)
 - rust-lang/rust#160354 (update `ambiguous_glob_imported_trait` lint explanation and example.)
 - rust-lang/rust#161447 (Construct paramenvs from an iterator)
 - rust-lang/rust#161707 (pattern_type: make print format match the current syntax)
 - rust-lang/rust#161773 (Update WASI targets to wasi-sdk-34)
 - rust-lang/rust#161807 (bootstrap: skip StdarchVerify when remote testing is enabled)
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 28, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#161433 (Overhaul `rustc_middle::query`)
 - rust-lang/rust#158370 (rewrite never type documentation)
 - rust-lang/rust#160354 (update `ambiguous_glob_imported_trait` lint explanation and example.)
 - rust-lang/rust#161447 (Construct paramenvs from an iterator)
 - rust-lang/rust#161707 (pattern_type: make print format match the current syntax)
 - rust-lang/rust#161773 (Update WASI targets to wasi-sdk-34)
 - rust-lang/rust#161807 (bootstrap: skip StdarchVerify when remote testing is enabled)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants