diff options
| author | bors <bors@rust-lang.org> | 2024-08-12 14:34:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-08-12 14:34:10 +0000 |
| commit | 0a336b3934913793639599ad80777881070c5d7f (patch) | |
| tree | c8180aa9ba87625aeaf409552b040d86fdee878d /tests/rustdoc-js-std/parser-slice-array.js | |
| parent | e66f3db9fa890fa6eb85ff5d55ff837455f81124 (diff) | |
| parent | 3bb7f35ec4ec19b398abc66fe38e645b117195dc (diff) | |
| download | rust-0a336b3934913793639599ad80777881070c5d7f.tar.gz rust-0a336b3934913793639599ad80777881070c5d7f.zip | |
Auto merge of #17865 - ShoyuVanilla:exhaust-block, r=Veykril
fix: Missing non-exhaustive let diagnostics inside async or unsafe block
The reason that this test doesn't have a pointer deref case is because the following code;
```rust
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),
https://github.com/rust-lang/rust-analyzer/blob/0daeb5c0b05cfdf2101b0f078c27539099bf38e6/crates/hir-ty/src/diagnostics/expr.rs#L256-L257
while the following is getting a block with a single stmt without tail 🤔
```rust
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 https://github.com/rust-lang/rust-analyzer/pull/17853#discussion_r1712993585_
Diffstat (limited to 'tests/rustdoc-js-std/parser-slice-array.js')
0 files changed, 0 insertions, 0 deletions
