fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.5 KiB31 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   |            -------------------------------------------------   ^^^^^^^^^^^^^^^^^^^ 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
12error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid
13  --> $DIR/reify-intrinsic.rs:11:13
14   |
15LL |     let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize) -> usize;
16   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17
18error[E0308]: cannot coerce intrinsics to function pointers
19  --> $DIR/reify-intrinsic.rs:18:9
20   |
21LL |         std::intrinsics::unlikely,
22   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
23   |
24   = note: expected fn item `extern "rust-intrinsic" fn(_) -> _ {likely}`
25              found fn item `extern "rust-intrinsic" fn(_) -> _ {unlikely}`
26   = note: different fn items have unique types, even if their signatures are the same
27
28error: aborting due to 3 previous errors
29
30Some errors have detailed explanations: E0308, E0606.
31For more information about an error, try `rustc --explain E0308`.