mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
36c22f7cf7
Tests that dead code warnings work correctly inside const _ blocks. Issue was already fixed, adding regression test as requested.
15 lines
374 B
Rust
15 lines
374 B
Rust
//@ check-pass
|
|
// Test for issue #101532 - dead code warnings should work inside const _
|
|
|
|
#![warn(dead_code)]
|
|
|
|
const _: () = {
|
|
let a: ();
|
|
struct B {} //~ WARN struct `B` is never constructed
|
|
enum C {} //~ WARN enum `C` is never used
|
|
fn d() {} //~ WARN function `d` is never used
|
|
const E: () = {}; //~ WARN constant `E` is never used
|
|
};
|
|
|
|
fn main() {}
|