about summary refs log tree commit diff
path: root/tests/rustdoc-ui/target-feature-stability.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-02-28 16:51:53 +0100
committerRalf Jung <post@ralfj.de>2025-02-28 16:51:53 +0100
commitdc04c0ca48c7285d74a0489354ed7d013dc25799 (patch)
tree71928ee473b6c93a73f56d8d57a1336ca24456b6 /tests/rustdoc-ui/target-feature-stability.rs
parent039af88e09f4f4beb47406f4771bffc2e61d800a (diff)
downloadrust-dc04c0ca48c7285d74a0489354ed7d013dc25799.tar.gz
rust-dc04c0ca48c7285d74a0489354ed7d013dc25799.zip
add test
Diffstat (limited to 'tests/rustdoc-ui/target-feature-stability.rs')
-rw-r--r--tests/rustdoc-ui/target-feature-stability.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/rustdoc-ui/target-feature-stability.rs b/tests/rustdoc-ui/target-feature-stability.rs
new file mode 100644
index 00000000000..4ade9690310
--- /dev/null
+++ b/tests/rustdoc-ui/target-feature-stability.rs
@@ -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() {}