summaryrefslogtreecommitdiffstats
path: root/tests/ui/nonscalar-cast.fixed
blob: 0a4b98469b2b6c356b60af5f9aac6dc47a03f464 (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!("{}", isize::from(Foo { x: 1 })); //~ non-primitive cast: `Foo` as `isize` [E0605]
}