rust/tests/ui/nonscalar-cast.fixed

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
256 B
Rust
Raw Normal View History

//@ 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]
}