summary refs log tree commit diff
path: root/src/test/ui/cast/cast-to-bare-fn.stderr
blob: 84933dca929a4f34637fcd397fa7895edf7c6224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
error[E0605]: non-primitive cast: `fn(isize) {foo}` as `extern "C" fn() -> isize`
  --> $DIR/cast-to-bare-fn.rs:5:13
   |
LL |     let x = foo as extern "C" fn() -> isize;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait

error[E0605]: non-primitive cast: `u64` as `fn(isize) -> (isize, isize)`
  --> $DIR/cast-to-bare-fn.rs:7:13
   |
LL |     let y = v as extern "Rust" fn(isize) -> (isize, isize);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0605`.