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

fix: Missing non-exhaustive let diagnostics inside async or unsafe block #17865

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

ShoyuVanilla
Copy link
Member

The reason that this test doesn't have a pointer deref case is because the following code;

fn test(ptr: *const Result<i32, !>) {
    unsafe {
        let Ok(_x) = *ptr;
    }
}

is getting a block with no stmts but tail one in here(thus, no diagnostic error),

fn validate_block(&mut self, db: &dyn HirDatabase, expr: &Expr) {
let Expr::Block { statements, .. } = expr else { return };

while the following is getting a block with a single stmt without tail 🤔

fn test(x: Result<i32, &'static !>) {
    let Ok(_y) = x;
}

I'll make a more deep inspection and file this as a new issue

Originally posted by @ShoyuVanilla in #17853 (comment)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 12, 2024
@Veykril
Copy link
Member

Veykril commented Aug 12, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Aug 12, 2024

📌 Commit db24cf5 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 12, 2024

⌛ Testing commit db24cf5 with merge 32a86cb...

@bors
Copy link
Contributor

bors commented Aug 12, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 32a86cb to master...

@bors bors merged commit 32a86cb into rust-lang:master Aug 12, 2024
11 checks passed
@ShoyuVanilla ShoyuVanilla deleted the exhaust-block branch August 12, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants