diff options
| author | Urgau <urgau@numericable.fr> | 2025-05-01 18:15:04 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2025-05-22 20:10:32 +0200 |
| commit | 9d9705f4c360df5d8c77876496b0c5594cbc7fa0 (patch) | |
| tree | 98d9fb2cccee0efc04c7d028134e1e83b4871128 /tests/rustdoc-ui/doctest/dead-code-module-2.rs | |
| parent | 80c6a0885079038caa0bc90670afbf5ead806c17 (diff) | |
| download | rust-9d9705f4c360df5d8c77876496b0c5594cbc7fa0.tar.gz rust-9d9705f4c360df5d8c77876496b0c5594cbc7fa0.zip | |
Collect and use `#![doc(test(attr(..)))]` at module level too
Diffstat (limited to 'tests/rustdoc-ui/doctest/dead-code-module-2.rs')
| -rw-r--r-- | tests/rustdoc-ui/doctest/dead-code-module-2.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/rustdoc-ui/doctest/dead-code-module-2.rs b/tests/rustdoc-ui/doctest/dead-code-module-2.rs new file mode 100644 index 00000000000..de7b11b91ec --- /dev/null +++ b/tests/rustdoc-ui/doctest/dead-code-module-2.rs @@ -0,0 +1,27 @@ +// Same test as dead-code-module but with 2 doc(test(attr())) at different levels. + +//@ edition: 2024 +//@ compile-flags:--test +//@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR" +//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" +//@ failure-status: 101 + +#![doc(test(attr(allow(unused_variables))))] + +mod my_mod { + #![doc(test(attr(deny(warnings))))] + + /// Example + /// + /// ```rust,no_run + /// trait T { fn f(); } + /// ``` + pub fn f() {} +} + +/// Example +/// +/// ```rust,no_run +/// trait OnlyWarning { fn no_deny_warnings(); } +/// ``` +pub fn g() {} |
