add test
authorRalf Jung <post@ralfj.de>
Fri, 28 Feb 2025 15:51:53 +0000 (16:51 +0100)
committerPeter Michael Green <plugwash@debian.org>
Tue, 8 Apr 2025 23:21:36 +0000 (23:21 +0000)
(cherry picked from commit dc04c0ca48c7285d74a0489354ed7d013dc25799)

tests/rustdoc-ui/target-feature-stability.rs [new file with mode: 0644]

diff --git a/tests/rustdoc-ui/target-feature-stability.rs b/tests/rustdoc-ui/target-feature-stability.rs
new file mode 100644 (file)
index 0000000..4ade969
--- /dev/null
@@ -0,0 +1,18 @@
+//! This is a regression test for <https://github.com/rust-lang/rust/issues/137366>, ensuring
+//! that we can use the `neon` target feature on ARM-32 targets in rustdoc despite there
+//! being a "forbidden" feature of the same name for aarch64, and rustdoc merging the
+//! target features of all targets.
+//@ check-pass
+//@ compile-flags: --target armv7-unknown-linux-gnueabihf
+
+#![crate_type = "lib"]
+#![feature(no_core, lang_items)]
+#![feature(arm_target_feature)]
+#![no_core]
+
+#[lang = "sized"]
+pub trait Sized {}
+
+// `fp-armv8` is "forbidden" on aarch64 as we tie it to `neon`.
+#[target_feature(enable = "fp-armv8")]
+pub fn fun() {}