Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deny FnDef in patterns #114668

Merged
merged 1 commit into from
Aug 15, 2023
Merged

Deny FnDef in patterns #114668

merged 1 commit into from
Aug 15, 2023

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Aug 9, 2023

We can only see these via const { .. } patterns, which are unstable.

cc #76001 (tracking issue for inline const pats)

Fixes #114658
Fixes #114659

@rustbot
Copy link
Collaborator

rustbot commented Aug 9, 2023

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot 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 Aug 9, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

LGTM, assuming this shouldn't be an error.

AFAIR, "exotic" types in patterns produced errors some time ago, but maybe they do not now?
@rustbot author

@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 10, 2023
@compiler-errors
Copy link
Member Author

This isn't waiting on author -- I'm waiting for advice on how to proceed w/ this PR 😸

@rustbot ready

@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 13, 2023
@compiler-errors
Copy link
Member Author

That is to say, I'm happy to either:

  1. Land this PR as-is,
  2. Make FnDefs in consts a hard error, guaranteed others also agree this is the right behavior (since this can happen only with unstable features, not sure if it necessarily even needs T-lang).

@petrochenkov
Copy link
Contributor

In don't see the place which @cjgillot is talking about in #114668 (comment), but let's make it an error for now.
@rustbot author

@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 14, 2023
@compiler-errors compiler-errors changed the title Dont emit BinOp::Eq on pattern match equality test for FnDef type Deny FnDef in patterns Aug 15, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 15, 2023

Some changes might have occurred in exhaustiveness checking

cc @Nadrieril

@compiler-errors
Copy link
Member Author

@rustbot ready

@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 15, 2023
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 15, 2023

📌 Commit 1f42be6 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 15, 2023
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 15, 2023
@bors
Copy link
Contributor

bors commented Aug 15, 2023

⌛ Testing commit 1f42be6 with merge a77e393758d35a955e9f532caf68def68a5ca946...

@rust-log-analyzer
Copy link
Collaborator

The job armhf-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Aug 15, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 15, 2023
@petrochenkov
Copy link
Contributor

@bors retry

@bors bors 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 15, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 15, 2023
…trochenkov

Deny `FnDef` in patterns

We can only see these via `const { .. }` patterns, which are unstable.

cc rust-lang#76001 (tracking issue for inline const pats)

Fixes rust-lang#114658
Fixes rust-lang#114659
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 15, 2023
…trochenkov

Deny `FnDef` in patterns

We can only see these via `const { .. }` patterns, which are unstable.

cc rust-lang#76001 (tracking issue for inline const pats)

Fixes rust-lang#114658
Fixes rust-lang#114659
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#114588 (Improve docs for impl Default for ExitStatus)
 - rust-lang#114619 (Fix pthread_attr_union layout on Wasi)
 - rust-lang#114644 (Point out expectation even if we have `TypeError::RegionsInsufficientlyPolymorphic`)
 - rust-lang#114668 (Deny `FnDef` in patterns)
 - rust-lang#114819 (Point at return type when it influences non-first `match` arm)
 - rust-lang#114826 (Fix typos)
 - rust-lang#114837 (add missing feature(error_in_core))
 - rust-lang#114853 (Migrate GUI colors test to original CSS color format)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5baf2a1 into rust-lang:master Aug 15, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 15, 2023
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
6 participants