mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +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`.
15 lines
295 B
Rust
15 lines
295 B
Rust
//@ compile-flags:-C panic=abort
|
|
//@ only-x86_64
|
|
|
|
#![no_std]
|
|
#![no_main]
|
|
|
|
use core::panic::PanicInfo;
|
|
|
|
#[panic_handler]
|
|
#[target_feature(enable = "avx2")]
|
|
//~^ ERROR `#[target_feature]` cannot be applied to a `#[panic_handler]` function
|
|
fn panic(info: &PanicInfo) -> ! {
|
|
unimplemented!();
|
|
}
|