mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-04 01:44:15 +00:00
Use `TargetFeatureParser` to reject `#[target_feature]` on functions marked as lang items (via `#[lang = "..."]` or `#[panic_handler]`), replacing `check_target_feature` in `rustc_passes`.
14 lines
426 B
Plaintext
14 lines
426 B
Plaintext
error: `#[target_feature]` cannot be applied to a `#[panic_handler]` function
|
|
--> $DIR/panic-handler-with-target-feature.rs:10:1
|
|
|
|
|
LL | #[target_feature(enable = "avx2")]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
LL |
|
|
LL | / fn panic(info: &PanicInfo) -> ! {
|
|
LL | | unimplemented!();
|
|
LL | | }
|
|
| |_- `#[panic_handler]` function is not allowed to have `#[target_feature]`
|
|
|
|
error: aborting due to 1 previous error
|
|
|