mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
17 lines
252 B
Rust
17 lines
252 B
Rust
//@ 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]
|
|
}
|