]> git.lizzy.rs Git - rust.git/blob - tests/ui/reify-intrinsic.stderr
Rollup merge of #106701 - ibraheemdev:sync-sender-spin, r=Amanieu
[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 always have unique types, even if their signatures are the same
27    = help: change the expected type to be function pointer `extern "rust-intrinsic" fn(bool) -> bool`
28    = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `likely as extern "rust-intrinsic" fn(bool) -> bool`
29
30 error: aborting due to 3 previous errors
31
32 Some errors have detailed explanations: E0308, E0606.
33 For more information about an error, try `rustc --explain E0308`.