about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/enum-option.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-05 01:33:58 +0000
committerbors <bors@rust-lang.org>2023-06-05 01:33:58 +0000
commite4106065bf1bb515935d5d024e8d9c86454e2b22 (patch)
tree2dc430f81aa163717f435f8f4ec6c82c8dffaeeb /tests/rustdoc-js-std/enum-option.js
parentdcf3571c513a29a60a5061ce84c3c618cf5e4cd5 (diff)
parent55b4549602d2f1105aedd7a1357a62db4f128167 (diff)
downloadrust-e4106065bf1bb515935d5d024e8d9c86454e2b22.tar.gz
rust-e4106065bf1bb515935d5d024e8d9c86454e2b22.zip
Auto merge of #112272 - jieyouxu:issue-112269, r=compiler-errors
Show note for type ascription on a local binding interpreted as a constant pattern and 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 PR extends the note for type ascription of a constant pattern to `AscribeUserType` patterns which have `Constant` subpatterns.

Fixes #112269.
Diffstat (limited to 'tests/rustdoc-js-std/enum-option.js')
0 files changed, 0 insertions, 0 deletions