]> git.lizzy.rs Git - rust.git/blob - tests/ui/reify-intrinsic.stderr
Rollup merge of #107598 - chenyukang:yukang/fix-core-bench, r=thomcc
[rust.git] / tests / ui / reify-intrinsic.stderr
1 error[E0308]: cannot coerce intrinsics to function pointers
2   --> $DIR/reify-intrinsic.rs:6:64
3    |
4 LL |     let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute;
5    |            -------------------------------------------------   ^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
6    |            |
7    |            expected due to this
8    |
9    = note: expected fn pointer `unsafe extern "rust-intrinsic" fn(isize) -> usize`
10                  found fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
11    = note: when the arguments and return types match, functions can be coerced to function pointers
12
13 error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid
14   --> $DIR/reify-intrinsic.rs:11:13
15    |
16 LL |     let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize) -> usize;
17    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
19 error[E0308]: cannot coerce intrinsics to function pointers
20   --> $DIR/reify-intrinsic.rs:18:9
21    |
22 LL |         std::intrinsics::unlikely,
23    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
24    |
25    = note: expected fn item `extern "rust-intrinsic" fn(_) -> _ {likely}`
26               found fn item `extern "rust-intrinsic" fn(_) -> _ {unlikely}`
27    = note: different fn items have unique types, even if their signatures are the same
28
29 error: aborting due to 3 previous errors
30
31 Some errors have detailed explanations: E0308, E0606.
32 For more information about an error, try `rustc --explain E0308`.