rust/tests/rustdoc-ui/2024-doctests-checks.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
673 B
Rust
Raw Normal View History

//@ check-pass
//@ compile-flags: --test --test-args=--test-threads=1 -Zunstable-options --edition 2024
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
/// ```
/// let x = 12;
/// ```
///
/// This one should not be a merged doctest (because of `$crate`). The output
/// will confirm it by displaying both merged and standalone doctest passes.
///
/// ```
/// macro_rules! bla {
/// () => {{
/// $crate::foo();
/// }}
/// }
///
/// fn foo() {}
///
/// fn main() {
/// bla!();
/// }
/// ```
pub struct Foo;