Skip to content

#[target_feature] is allowed on #[panic_handler] with target_feature 1.1 #109411

Closed
@est31

Description

@est31

This works (but it shouldn't):

#![feature(target_feature_11)]
#![no_std]

use core::panic::PanicInfo;

#[panic_handler]
#[target_feature(enable = "avx2")]
fn panic(_info: &PanicInfo) -> ! {
    loop {}
}

similar to #108645 , cc #69098 (tracking issue)

@rustbot label T-lang T-compiler C-bug I-unsound F-target_feature_11

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-target_feature_11target feature 1.1 RFCI-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions