Skip to content

Tied target feature validation occurs too late #105110

@calebzulawski

Description

@calebzulawski
Member

I tried this code: https://rust.godbolt.org/z/b6bjzeKz3

#[target_feature(enable = "paca")]
unsafe fn foo() {}

I expected to see this happen: this should fail to compile and require the pacg feature

Instead, this happened: it compiled. If the function is ever used, or if you make it pub, it fails to compile. See also rust-lang/stdarch#1352 (comment)

Meta

rustc --version --verbose:

rustc 1.65.0 (897e37553 2022-11-02)
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: x86_64-apple-darwin
release: 1.65.0
LLVM version: 15.0.0

Activity

added 2 commits that reference this issue on Oct 10, 2024
b38afa0
5b2942e
added a commit that references this issue on Oct 10, 2024
7dc0ce4
added a commit that references this issue on Oct 10, 2024
13976f1
added a commit that references this issue on Oct 10, 2024
e920f42
added a commit that references this issue on Jan 13, 2025
2ca5753
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @calebzulawski@workingjubilee

      Issue actions

        Tied target feature validation occurs too late · Issue #105110 · rust-lang/rust