mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-12 18:07:40 +00:00
28 lines
1.0 KiB
Plaintext
28 lines
1.0 KiB
Plaintext
error[E0308]: mismatched types
|
|
--> $DIR/foreign-fn.rs:17:30
|
|
|
|
|
LL | let _: extern "C" fn() = default_unsafe_foo;
|
|
| --------------- ^^^^^^^^^^^^^^^^^^ expected safe fn, found unsafe fn
|
|
| |
|
|
| expected due to this
|
|
|
|
|
= note: expected fn pointer `extern "C" fn()`
|
|
found fn item `unsafe extern "C" fn() {default_unsafe_foo}`
|
|
= note: unsafe functions cannot be coerced into safe function pointers
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/foreign-fn.rs:19:30
|
|
|
|
|
LL | let _: extern "C" fn() = unsafe_foo;
|
|
| --------------- ^^^^^^^^^^ expected safe fn, found unsafe fn
|
|
| |
|
|
| expected due to this
|
|
|
|
|
= note: expected fn pointer `extern "C" fn()`
|
|
found fn item `unsafe extern "C" fn() {unsafe_foo}`
|
|
= note: unsafe functions cannot be coerced into safe function pointers
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|