diff options
| author | 许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com> | 2023-06-04 20:33:33 +0800 |
|---|---|---|
| committer | 许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com> | 2023-06-04 20:49:30 +0800 |
| commit | 55b4549602d2f1105aedd7a1357a62db4f128167 (patch) | |
| tree | 100f6250a96718af97da4da0aabe33aecaed0c12 /tests/rustdoc-js-std/enum-option.js | |
| parent | 9eee230cd0a56bfba3ce65121798d9f9f4341cdd (diff) | |
| download | rust-55b4549602d2f1105aedd7a1357a62db4f128167.tar.gz rust-55b4549602d2f1105aedd7a1357a62db4f128167.zip | |
Show note for type ascription interpreted as a constant pattern, not a new variable
Given the code
```rust
pub fn main() {
const y: i32 = 4;
let y: i32 = 3;
}
```
`y` in the let binding is actually interpreted as a constant pattern
and is not a new variable, causing confusing diagnostics about
refutable patterns in local binding.
This commit extends the note for type ascription as a constant pattern
to `AscribeUserType` patterns as well.
Diffstat (limited to 'tests/rustdoc-js-std/enum-option.js')
0 files changed, 0 insertions, 0 deletions
