forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#98390 - GuillaumeGomez:keyword-rustdoc-json…
…, r=notriddle Fixes handling of keywords in rustdoc json output Fixes rust-lang#98002. Instead of panicking, we just filter them out. cc `@matthiaskrgr` r? `@notriddle`
- Loading branch information
Showing
2 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Regression test for <https://github.com/rust-lang/rust/issues/98002>. | ||
|
||
// Keywords should not be generated in rustdoc JSON output and this test | ||
// ensures it. | ||
|
||
#![feature(rustdoc_internals)] | ||
#![no_std] | ||
|
||
// @has keyword.json | ||
// @!has - "$.index[*][?(@.name=='match')]" | ||
// @has - "$.index[*][?(@.name=='foo')]" | ||
|
||
#[doc(keyword = "match")] | ||
/// this is a test! | ||
pub mod foo {} | ||
|
||
// @!has - "$.index[*][?(@.name=='hello')]" | ||
// @!has - "$.index[*][?(@.name=='bar')]" | ||
#[doc(keyword = "hello")] | ||
/// hello | ||
mod bar {} |