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

Postfix match fixes #123394

Merged
merged 2 commits into from Apr 3, 2024
Merged

Conversation

compiler-errors
Copy link
Member

  1. Don't ice on expr as Ty.match {}
  2. Fix the suggestion span for non-exhaustive matches to add _ => todo!(),

Fixes #123383

@rustbot
Copy link
Collaborator

rustbot commented Apr 2, 2024

r? @estebank

rustbot has assigned @estebank.
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

@rustbot
Copy link
Collaborator

rustbot commented Apr 2, 2024

Some changes occurred in match checking

cc @Nadrieril

@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 Apr 2, 2024
Comment on lines +508 to +512
// This is horrendous, and we should deal with it by just
// stashing the span of the braces somewhere (like in the match source).
scrut.span.find_ancestor_in_same_ctxt(expr_span).and_then(|scrut_span| {
let sm = self.tcx.sess.source_map();
let brace_span = sm.span_extend_to_next_char(scrut_span, '{', true);
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, we need to audit and remove every span_extend_to_next_char or leave a comment explaining what stopped us from doing so.

@estebank
Copy link
Contributor

estebank commented Apr 3, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Apr 3, 2024

📌 Commit bed8b70 has been approved by estebank

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

Rollup of 7 pull requests

Successful merges:

 - rust-lang#123209 (Add section to sanitizer doc for `-Zexternal-clangrt`)
 - rust-lang#123342 (x.py test: remove no-op --skip flag)
 - rust-lang#123382 (Assert `FnDef` kind)
 - rust-lang#123386 (Set `CARGO` instead of `PATH` for Rust Clippy)
 - rust-lang#123393 (rustc_ast: Update `P<T>` docs to reflect mutable status.)
 - rust-lang#123394 (Postfix match fixes)
 - rust-lang#123412 (Output URLs of CI artifacts to GitHub summary)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit deb48aa into rust-lang:master Apr 3, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 3, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 3, 2024
Rollup merge of rust-lang#123394 - compiler-errors:postfix-match-fixes, r=estebank

Postfix match fixes

1. Don't ice on `expr as Ty.match {}`
2. Fix the suggestion span for non-exhaustive matches to add `_ => todo!(),`

Fixes rust-lang#123383
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: entered unreachable code: parse_dot_or_call_expr_with_ shouldn't produce this
5 participants