Skip to content

Commit 75ad2f7

Browse files
Add test for keywords in rustdoc JSON output
1 parent 8e40d93 commit 75ad2f7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/test/rustdoc-json/keyword.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/98002>.
2+
3+
// Keywords should not be generated in rustdoc JSON output and this test
4+
// ensures it.
5+
6+
#![feature(rustdoc_internals)]
7+
#![no_std]
8+
9+
// @has keyword.json
10+
// @!has - "$.index[*][?(@.name=='match')]"
11+
// @has - "$.index[*][?(@.name=='foo')]"
12+
13+
#[doc(keyword = "match")]
14+
/// this is a test!
15+
pub mod foo {}
16+
17+
// @!has - "$.index[*][?(@.name=='hello')]"
18+
// @!has - "$.index[*][?(@.name=='bar')]"
19+
#[doc(keyword = "hello")]
20+
/// hello
21+
mod bar {}

0 commit comments

Comments
 (0)