diff options
| author | bors <bors@rust-lang.org> | 2023-12-08 17:08:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-08 17:08:52 +0000 |
| commit | f39d18b7a01d908e6eb509f657f1ffbb4ecb273d (patch) | |
| tree | 2c78c39e210e7e50d4d332da23cab8c510226408 /tests/rustdoc-js-std/osstring-to-string.js | |
| parent | 5f191ce9b9fc83e9b5295af8302f7dc661d8240d (diff) | |
| parent | 7ffe1ff55f74064815afd81cda2d353c835ed3ef (diff) | |
| download | rust-f39d18b7a01d908e6eb509f657f1ffbb4ecb273d.tar.gz rust-f39d18b7a01d908e6eb509f657f1ffbb4ecb273d.zip | |
Auto merge of #118527 - Nadrieril:never_patterns_parse, r=compiler-errors
never_patterns: Parse match arms with no body
Never patterns are meant to signal unreachable cases, and thus don't take bodies:
```rust
let ptr: *const Option<!> = ...;
match *ptr {
None => { foo(); }
Some(!),
}
```
This PR makes rustc accept the above, and enforces that an arm has a body xor is a never pattern. This affects parsing of match arms even with the feature off, so this is delicate. (Plus this is my first non-trivial change to the parser).
~~The last commit is optional; it introduces a bit of churn to allow the new suggestions to be machine-applicable. There may be a better solution? I'm not sure.~~ EDIT: I removed that commit
r? `@compiler-errors`
Diffstat (limited to 'tests/rustdoc-js-std/osstring-to-string.js')
0 files changed, 0 insertions, 0 deletions
