diff --git a/tests/rustdoc-ui/auxiliary/panic-handler.rs b/tests/rustdoc-ui/auxiliary/panic-handler.rs new file mode 100644 index 00000000000..0aaaeee1051 --- /dev/null +++ b/tests/rustdoc-ui/auxiliary/panic-handler.rs @@ -0,0 +1,9 @@ +// compile-flags: -C panic=abort + +#![no_std] +#![no_main] + +#[panic_handler] +fn panic(_: &core::panic::PanicInfo) -> ! { + loop {} +} diff --git a/tests/rustdoc-ui/issue-107918.rs b/tests/rustdoc-ui/issue-107918.rs new file mode 100644 index 00000000000..13788df0fc9 --- /dev/null +++ b/tests/rustdoc-ui/issue-107918.rs @@ -0,0 +1,12 @@ +// aux-build:panic-handler.rs +// compile-flags: --document-private-items +// build-pass +// ignore-windows + +#![no_std] +#![no_main] + +#[panic_handler] +fn panic(_: &core::panic::PanicInfo) -> ! { + loop {} +}