fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
815 B19 linesraw
1error[E0605]: non-primitive cast: `fn(isize) {foo}` as `extern "C" fn() -> isize`
2  --> $DIR/cast-to-bare-fn.rs:5:13
3   |
4LL |     let x = foo as extern "C" fn() -> isize;
5   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6   |
7   = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
8
9error[E0605]: non-primitive cast: `u64` as `fn(isize) -> (isize, isize)`
10  --> $DIR/cast-to-bare-fn.rs:7:13
11   |
12LL |     let y = v as extern "Rust" fn(isize) -> (isize, isize);
13   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14   |
15   = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
16
17error: aborting due to 2 previous errors
18
19For more information about this error, try `rustc --explain E0605`.