-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-HIRArea: The high-level intermediate representation (HIR)Area: The high-level intermediate representation (HIR)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Array length expressions can can do anything that a const
initializer can. However, the unused variables lint does not work inside an array length expression. For example,
fn main() {
let _ = [(); {
let x = 42;
35
}];
}
...compiles with no warnings:
Compiling playground v0.0.1 (/playground)
Finished dev [unoptimized + debuginfo] target(s) in 0.51s
Running `target/debug/playground`
197g and scottmcm
Metadata
Metadata
Assignees
Labels
A-HIRArea: The high-level intermediate representation (HIR)Area: The high-level intermediate representation (HIR)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.