diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-06-13 21:02:26 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-08-28 15:56:30 +0200 |
| commit | 75cbd05d19a7cfb0819f15a57f2561cd28a956a7 (patch) | |
| tree | 57a503a0946816eb448d4d5d8964b9f49493ea1e /tests/rustdoc-json/doc_attribute.rs | |
| parent | ab0ee84eac9732e4e81e559c688846b4c1bd400a (diff) | |
| download | rust-75cbd05d19a7cfb0819f15a57f2561cd28a956a7.tar.gz rust-75cbd05d19a7cfb0819f15a57f2561cd28a956a7.zip | |
Add tests for `doc(attribute = "...")` attribute
Diffstat (limited to 'tests/rustdoc-json/doc_attribute.rs')
| -rw-r--r-- | tests/rustdoc-json/doc_attribute.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/rustdoc-json/doc_attribute.rs b/tests/rustdoc-json/doc_attribute.rs new file mode 100644 index 00000000000..9e1a711f0b7 --- /dev/null +++ b/tests/rustdoc-json/doc_attribute.rs @@ -0,0 +1,18 @@ +// Doc attributes (`#[doc(attribute = "...")]` should not be generated in rustdoc JSON output +// and this test ensures it. + +#![feature(rustdoc_internals)] +#![no_std] + +//@ !has "$.index[?(@.name=='repr')]" +//@ has "$.index[?(@.name=='foo')]" + +#[doc(attribute = "repr")] +/// this is a test! +pub mod foo {} + +//@ !has "$.index[?(@.name=='forbid')]" +//@ !has "$.index[?(@.name=='bar')]" +#[doc(attribute = "forbid")] +/// hello +mod bar {} |
