summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/as_underscore.rs
blob: a8cfb81d9a3f0b6b29408261ab5f097298aa726c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//@run-rustfix

#![warn(clippy::as_underscore)]

fn foo(_n: usize) {}

fn main() {
    let n: u16 = 256;
    foo(n as _);

    let n = 0_u128;
    let _n: u8 = n as _;
}