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

Account for match expr in single line #105347

Merged
merged 1 commit into from
Dec 28, 2022
Merged

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Dec 6, 2022

When encountering match Some(42) { Some(x) => x, None => "" };, output

error[E0308]: `match` arms have incompatible types
 --> f53.rs:2:52
  |
2 |     let _ = match Some(42) { Some(x) => x, None => "" };
  |             --------------              -          ^^ expected integer, found `&str`
  |             |                           |
  |             |                           this is found to be of type `{integer}`
  |             `match` arms have incompatible types

@rustbot
Copy link
Collaborator

rustbot commented Dec 6, 2022

r? @wesleywiser

(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 Dec 6, 2022
@compiler-errors
Copy link
Member

This could use a test, though I guess it's not critical.

When encountering `match Some(42) { Some(x) => x, None => "" };`, output

```
error[E0308]: `match` arms have incompatible types
 --> f53.rs:2:52
  |
2 |     let _ = match Some(42) { Some(x) => x, None => "" };
  |             --------------              -          ^^ expected integer, found `&str`
  |             |                           |
  |             |                           this is found to be of type `{integer}`
  |             `match` arms have incompatible types
  ```
@estebank
Copy link
Contributor Author

r? @compiler-errors

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 28, 2022

📌 Commit 05e8ba1 has been approved by compiler-errors

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 Dec 28, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 28, 2022
…fee1-dead

Rollup of 9 pull requests

Successful merges:

 - rust-lang#94145 (Test leaking of BinaryHeap Drain iterators)
 - rust-lang#103945 (Remove `iter::Empty` hack)
 - rust-lang#104024 (Fix `unused_must_use` warning for `Box::from_raw`)
 - rust-lang#104708 (Fix backoff doc to match implementation)
 - rust-lang#105347 (Account for `match` expr in single line)
 - rust-lang#105484 (Implement allow-by-default `multiple_supertrait_upcastable` lint)
 - rust-lang#106184 (Fix `core::any` docs)
 - rust-lang#106201 (Emit fewer errors on invalid `#[repr(transparent)]` on `enum`)
 - rust-lang#106205 (Remove some totally duplicated files in `rustc_infer`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ade9605 into rust-lang:master Dec 28, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 28, 2022
@estebank estebank deleted the single-line-match branch November 9, 2023 05:14
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.

5 participants