]> git.lizzy.rs Git - rust.git/blob - tests/ui/reify-intrinsic.stderr
Rollup merge of #107244 - notriddle:notriddle/primitive-reference-link, r=GuillaumeGomez
[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
12 error[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    |
15 LL |     let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize) -> usize;
16    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17
18 error[E0308]: cannot coerce intrinsics to function pointers
19   --> $DIR/reify-intrinsic.rs:18:9
20    |
21 LL |         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
28 error: aborting due to 3 previous errors
29
30 Some errors have detailed explanations: E0308, E0606.
31 For more information about an error, try `rustc --explain E0308`.