Skip to content

Rustdoc failure in armv7 targets with -neon with target_feature(enable = "neon") #134511

Closed
@sayantn

Description

@sayantn

I tried this code:

#![feature(arm_target_feature)]

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

This always compiles, but in armv7 targets that have -neon target-feature, running rustdoc on it produces the error

error: target feature `neon` cannot be toggled with `#[target_feature]`: unsound on hard-float targets because it changes float ABI
 --> bug.rs:3:18
  |
5 | #[target_feature(enable = "neon")]
  |

even if the target has +soft-float (e.g armv7-unknown-linux-gnueabi).

rustc --version --verbose:

rustc 1.85.0-nightly (9e136a30a 2024-12-19)
binary: rustc
commit-hash: 9e136a30a965bf4e63f03095c57df7257bf96fd6
commit-date: 2024-12-19
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.6

Related: #133417

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.C-bugCategory: This is a bug.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions