rust/tests/rustdoc-ui/doctest/dead-code-2024.rs
2024-10-01 17:08:01 +02:00

16 lines
459 B
Rust

// This test ensures that the 2024 edition merged doctest will not use `#[allow(unused)]`.
//@ compile-flags:--test -Zunstable-options --edition 2024
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ failure-status: 101
#![doc(test(attr(allow(unused_variables), deny(warnings))))]
/// Example
///
/// ```rust,no_run
/// trait T { fn f(); }
/// ```
pub fn f() {}