Closed
Description
I tried this code:
fn main() {
if let Some([b'@', filename @ ..]) = Some(b"@abc123") {
println!("filename {:?}", filename);
}
}
I expected this to compile and print
filename [97, 98, 99, 49, 50, 51]
which it does with 1.45.0
Instead, it failed to compile on both 1.45.1 and nightly:
error[E0425]: cannot find value `filename` in this scope
--> src/main.rs:3:35
|
3 | println!("filename {:?}", filename);
| ^^^^^^^^ not found in this scope
error: aborting due to previous error
Meta
rustc --version --verbose
:
rustc 1.45.1 (c367798cf 2020-07-26)
binary: rustc
commit-hash: c367798cfd3817ca6ae908ce675d1d99242af148
commit-date: 2020-07-26
host: x86_64-unknown-linux-gnu
release: 1.45.1
LLVM version: 10.0