fork/rust

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

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

1.41.1
1.4 KiB23 linesraw
1error[E0308]: cannot coerce intrinsics to function pointers
2  --> $DIR/reify-intrinsic.rs:6:64
3   |
4LL |     let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute;
5   |            -------------------------------------------------   ^^^^^^^^^^^^^^^^^^^
6   |            |                                                   |
7   |            |                                                   cannot coerce intrinsics to function pointers
8   |            |                                                   help: use parentheses to call this function: `std::mem::transmute(...)`
9   |            expected due to this
10   |
11   = note: expected fn pointer `unsafe extern "rust-intrinsic" fn(isize) -> usize`
12                 found fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}`
13
14error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid
15  --> $DIR/reify-intrinsic.rs:11:13
16   |
17LL |     let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize) -> usize;
18   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19
20error: aborting due to 2 previous errors
21
22Some errors have detailed explanations: E0308, E0606.
23For more information about an error, try `rustc --explain E0308`.