diff --git a/tests/rustdoc-ui/hashtag-doctest.rs b/tests/rustdoc-ui/hashtag-doctest.rs new file mode 100644 index 00000000000..5f745611530 --- /dev/null +++ b/tests/rustdoc-ui/hashtag-doctest.rs @@ -0,0 +1,17 @@ +// This test ensures that `##` are not emitting a warning when generating +// docs with the 2024 edition (or any edition). +// Regression test for . + +//@ check-pass +//@revisions: edition2021 edition2024 +//@[edition2021] edition:2021 +//@[edition2024] edition:2024 + +#![deny(warnings)] + +//! Test +//! +//! ``` +//! ##[allow(dead_code)] +//! println!("hello world"); +//! ```