Skip to content

rustdoc: safe functions with #[target_feature] are marked as unsafe (⚠) on index page #142952

Description

@aDotInTheVoid

Code

#[target_feature(enable = "popcnt")]
pub fn add_simd(x: i32, y: i32) -> i32 {
    x + y
}

Reproduction Steps

rustdoc +nightly ./mcve.rs

Expected Outcome

Function isn't marked as unsafe in index page:

Image

Actual Output

Function is marked as ⚠ to indicate it's unsafe.

Image

But on the function's own page, it's correct.

Image

Version

rustdoc 1.90.0-nightly (706f244 2025-06-23)

Additional Details

Probably the same root cause as #142655 (comment)

Activity

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-rustdoc-uiArea: Rustdoc UI (generated HTML)A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions