summary refs log tree commit diff
path: root/tests/rustdoc
diff options
context:
space:
mode:
authorYotam Ofek <yotam.ofek@gmail.com>2025-02-27 13:20:52 +0000
committerYotam Ofek <yotam.ofek@gmail.com>2025-02-27 13:22:46 +0000
commit0881dba5d38331ecb0a4b4e259d77cf57b95636f (patch)
treef20e14c369b13dd149da814b09e65ce658025681 /tests/rustdoc
parent660241d1d47ac939e88163bab747c853be82eac0 (diff)
downloadrust-0881dba5d38331ecb0a4b4e259d77cf57b95636f.tar.gz
rust-0881dba5d38331ecb0a4b4e259d77cf57b95636f.zip
Move "unused_exter_crate" test from rustdoc-ui to rustdoc
Diffstat (limited to 'tests/rustdoc')
-rw-r--r--tests/rustdoc/auxiliary/panic-item.rs17
-rw-r--r--tests/rustdoc/unused-extern-crate.rs2
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/rustdoc/auxiliary/panic-item.rs b/tests/rustdoc/auxiliary/panic-item.rs
new file mode 100644
index 00000000000..ccf784f7284
--- /dev/null
+++ b/tests/rustdoc/auxiliary/panic-item.rs
@@ -0,0 +1,17 @@
+//@ no-prefer-dynamic
+#![crate_type = "lib"]
+#![no_std]
+#![feature(lang_items)]
+
+use core::panic::PanicInfo;
+use core::sync::atomic::{self, Ordering};
+
+#[panic_handler]
+fn panic(_info: &PanicInfo) -> ! {
+    loop {
+        atomic::compiler_fence(Ordering::SeqCst);
+    }
+}
+
+#[lang = "eh_personality"]
+fn foo() {}
diff --git a/tests/rustdoc/unused-extern-crate.rs b/tests/rustdoc/unused-extern-crate.rs
new file mode 100644
index 00000000000..cdc00fd313a
--- /dev/null
+++ b/tests/rustdoc/unused-extern-crate.rs
@@ -0,0 +1,2 @@
+//@ aux-crate:panic_item=panic-item.rs
+//@ has unused_extern_crate/index.html