about summary refs log tree commit diff
path: root/tests/ui/delegation/foreign-fn.stderr
blob: f7d3dba4bb1c0868751d20c05934f9ea56cfb9b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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`.