summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nonscalar-cast.rs
blob: 59fcf09666b24f32aa36a63b8029b8acd1064dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-rustfix

#[derive(Debug)]
struct Foo {
    x: isize
}

impl From<Foo> for isize {
    fn from(val: Foo) -> isize {
        val.x
    }
}

fn main() {
    println!("{}", Foo { x: 1 } as isize); //~ non-primitive cast: `Foo` as `isize` [E0605]
}