-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ICE on hidden tuple variant fields
this also renders them as `_`, which rustdoc previously did not.
- Loading branch information
1 parent
065a372
commit 4a915ac
Showing
2 changed files
with
61 additions
and
24 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,34 @@ | ||
// This test ensure that #[doc(hidden)] is applied correctly in enum variant fields. | ||
|
||
// Denotes a field which should be hidden. | ||
pub struct H; | ||
|
||
// Denotes a field which should not be hidden (shown). | ||
pub struct S; | ||
|
||
// @has issue_88600/enum.FooEnum.html | ||
pub enum FooEnum { | ||
// @has - '//*[@id="variant.HiddenTupleItem"]//code' 'HiddenTupleItem(_)' | ||
// @count - '//*[@id="variant.HiddenTupleItem.field.0"]' 0 | ||
HiddenTupleItem(#[doc(hidden)] H), | ||
// @has - '//*[@id="variant.MultipleHidden"]//code' 'MultipleHidden(_, _)' | ||
// @count - '//*[@id="variant.MultipleHidden.field.0"]' 0 | ||
// @count - '//*[@id="variant.MultipleHidden.field.1"]' 0 | ||
MultipleHidden(#[doc(hidden)] H, #[doc(hidden)] H), | ||
// @has - '//*[@id="variant.MixedHiddenFirst"]//code' 'MixedHiddenFirst(_, S)' | ||
// @count - '//*[@id="variant.MixedHiddenFirst.field.0"]' 0 | ||
// @has - '//*[@id="variant.MixedHiddenFirst.field.1"]' '1: S' | ||
MixedHiddenFirst(#[doc(hidden)] H, S), | ||
// @has - '//*[@id="variant.MixedHiddenLast"]//code' 'MixedHiddenLast(S, _)' | ||
// @has - '//*[@id="variant.MixedHiddenLast.field.0"]' '0: S' | ||
// @count - '//*[@id="variant.MixedHiddenLast.field.1"]' 0 | ||
MixedHiddenLast(S, #[doc(hidden)] H), | ||
// @has - '//*[@id="variant.HiddenStruct"]//code' 'HiddenStruct' | ||
// @count - '//*[@id="variant.HiddenStruct.field.h"]' 0 | ||
// @has - '//*[@id="variant.HiddenStruct.field.s"]' 's: S' | ||
HiddenStruct { | ||
#[doc(hidden)] | ||
h: H, | ||
s: S, | ||
}, | ||
} |