Files
rust/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr
2025-01-27 23:44:47 +01:00

34 lines
1.2 KiB
Plaintext

error[E0308]: mismatched types
--> $DIR/fn-ptr.rs:12:21
|
LL | #[target_feature(enable = "avx")]
| --------------------------------- `#[target_feature]` added here
...
LL | let foo: fn() = foo_avx;
| ---- ^^^^^^^ cannot coerce functions with `#[target_feature]` to safe function pointers
| |
| expected due to this
|
= note: expected fn pointer `fn()`
found fn item `#[target_features] fn() {foo_avx}`
= note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers
error[E0308]: mismatched types
--> $DIR/fn-ptr.rs:21:21
|
LL | #[target_feature(enable = "sse2")]
| ---------------------------------- `#[target_feature]` added here
...
LL | let foo: fn() = foo;
| ---- ^^^ cannot coerce functions with `#[target_feature]` to safe function pointers
| |
| expected due to this
|
= note: expected fn pointer `fn()`
found fn item `#[target_features] fn() {foo}`
= note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.