Skip to content

Add a TyPat in the AST to reuse the generic arg lowering logic - #136646

Merged
bors merged 1 commit into
rust-lang:masterfrom
oli-obk:pattern-types-ast
Feb 12, 2025
Merged

Add a TyPat in the AST to reuse the generic arg lowering logic#136646
bors merged 1 commit into
rust-lang:masterfrom
oli-obk:pattern-types-ast

Conversation

@oli-obk

Copy link
Copy Markdown
Contributor

This simplifies ast lowering significantly with little cost to the pattern types parser.

Also fixes any problems we've had with generic args (well, pushes any problems onto the generic_const_exprs feature gate)

follow-up to #136284 (comment)

r? @BoxyUwU

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 6, 2025
@rust-log-analyzer

This comment has been minimized.

@BoxyUwU

Copy link
Copy Markdown
Member

@rustbot author (ci failing)

@rustbotrustbot 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 Feb 10, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@oli-obkoli-obk 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 Feb 11, 2025
Comment on lines +79 to +80
pub operand: &'a Option<ptr::P<T>>,
pub span: Span,

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.

the struct is pub(crate) so there's no benefit to this being pub right?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yea but it's more characters 😅

@BoxyUwU

Copy link
Copy Markdown
Member

rustfmt changes look roughly right to me, not sure if we're supposed to get approval from rustfmt maintainers before this lands? r=me if we don't need that otherwise r=me after rustfmt approval

@BoxyUwUBoxyUwU 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 Feb 11, 2025
@oli-obk

Copy link
Copy Markdown
ContributorAuthor

Rustfmt needs more adjustments to handle pattern types anyway. I think it may be stripping the builtin macro and just leaving the plain Type is Pattern. Which is wrong, but this PR is not gonna make it wronger

@bors r=BoxyUwU

@bors

bors commented Feb 11, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 6d7ce4e has been approved by BoxyUwU

It is now in the queue for this repository.

@borsbors 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 Feb 11, 2025
@ytmimi

Copy link
Copy Markdown
Contributor

rustfmt changes look fine to me 👍🏼

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2025
Add a TyPat in the AST to reuse the generic arg lowering logic
This simplifies ast lowering significantly with little cost to the pattern types parser.
Also fixes any problems we've had with generic args (well, pushes any problems onto the `generic_const_exprs` feature gate)
follow-up to rust-lang#136284 (comment)
r? `@BoxyUwU`
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2025
…iaskrgr
Rollup of 8 pull requests
Successful merges:
- rust-lang#135549 (Document some safety constraints and use more safe wrappers)
- rust-lang#135965 (In "specify type" suggestion, skip type params that are already known)
- rust-lang#136193 (Implement pattern type ffi checks)
- rust-lang#136646 (Add a TyPat in the AST to reuse the generic arg lowering logic)
- rust-lang#136699 (std: replace the `FromInner` implementation for addresses with private conversion functions)
- rust-lang#136874 (Change the issue number for `likely_unlikely` and `cold_path`)
- rust-lang#136884 (Lower fn items as ZST valtrees and delay a bug)
- rust-lang#136885 (i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2025
…iaskrgr
Rollup of 8 pull requests
Successful merges:
- rust-lang#135549 (Document some safety constraints and use more safe wrappers)
- rust-lang#135965 (In "specify type" suggestion, skip type params that are already known)
- rust-lang#136193 (Implement pattern type ffi checks)
- rust-lang#136646 (Add a TyPat in the AST to reuse the generic arg lowering logic)
- rust-lang#136874 (Change the issue number for `likely_unlikely` and `cold_path`)
- rust-lang#136884 (Lower fn items as ZST valtrees and delay a bug)
- rust-lang#136885 (i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change)
- rust-lang#136891 (Check sig for errors before checking for unconstrained anonymous lifetime)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 516dd06 into rust-lang:masterFeb 12, 2025
@rustbotrustbot added this to the 1.86.0 milestone Feb 12, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2025
Rollup merge of rust-lang#136646 - oli-obk:pattern-types-ast, r=BoxyUwU
Add a TyPat in the AST to reuse the generic arg lowering logic
This simplifies ast lowering significantly with little cost to the pattern types parser.
Also fixes any problems we've had with generic args (well, pushes any problems onto the `generic_const_exprs` feature gate)
follow-up to rust-lang#136284 (comment)
r? ``@BoxyUwU``
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@oli-obk@rust-log-analyzer@BoxyUwU@rustbot@bors@ytmimi