From 0881dba5d38331ecb0a4b4e259d77cf57b95636f Mon Sep 17 00:00:00 2001 From: Yotam Ofek Date: Thu, 27 Feb 2025 13:20:52 +0000 Subject: Move "unused_exter_crate" test from rustdoc-ui to rustdoc --- tests/rustdoc/auxiliary/panic-item.rs | 17 +++++++++++++++++ tests/rustdoc/unused-extern-crate.rs | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 tests/rustdoc/auxiliary/panic-item.rs create mode 100644 tests/rustdoc/unused-extern-crate.rs (limited to 'tests/rustdoc') 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 -- cgit 1.4.1-3-g733a5