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

Validate that we're only matching on unit struct for path pattern #122910

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

compiler-errors
Copy link
Member

Resolution doesn't validate that we only really take CtorKind::Unit in path patterns, since all it sees is Res::SelfCtor(def_id). Check this instead during pattern typeck.

r? petrochenkov

Fixes #122809

@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 Mar 22, 2024
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Mar 25, 2024

📌 Commit 08235b1 has been approved by petrochenkov

It is now in the queue for this repository.

@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 Mar 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 25, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#122842 (Don't emit an error about failing to produce a file with a specific name if user never gave an explicit name)
 - rust-lang#122881 (Delegation: fix ICE on `bound_vars` divergence)
 - rust-lang#122910 (Validate that we're only matching on unit struct for path pattern)
 - rust-lang#122970 (Use `chunk_by` when building `ReverseSccGraph`)
 - rust-lang#122988 (add even more tests! )
 - rust-lang#122999 (Fix unpretty UI test when /tmp does not exist)
 - rust-lang#123001 (Rename `{enter,exit}_lint_attrs` to `check_attributes{,_post}`)
 - rust-lang#123022 (Add `async-closures/once.rs` back to cranelift tests)
 - rust-lang#123034 (Add a bunch of needs-unwind annotations to tests)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e9ec442 into rust-lang:master Mar 25, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 25, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 25, 2024
Rollup merge of rust-lang#122910 - compiler-errors:unit-struct-in-path-pat-only, r=petrochenkov

Validate that we're only matching on unit struct for path pattern

Resolution doesn't validate that we only really take `CtorKind::Unit` in path patterns, since all it sees is `Res::SelfCtor(def_id)`. Check this instead during pattern typeck.

r? petrochenkov

Fixes rust-lang#122809
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.

ICE: pattern has unexpected type
4 participants