-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 #98577 - GuillaumeGomez:associated-items, r=notriddle
Fix "kind" for associated types in trait implementations in rustdoc JSON Fixes #81340. Contrary to what is suggested in the issue, I really think we should distinguish between associated items and "normal" constants and types. cc `@CraftSpider` `@SimonSapin` r? `@notriddle`
- Loading branch information
Showing
2 changed files
with
34 additions
and
2 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,29 @@ | ||
#![no_std] | ||
|
||
// @has assoc_items.json | ||
|
||
pub struct Simple; | ||
|
||
impl Simple { | ||
// @has - "$.index[*][?(@.name=='CONSTANT')].kind" \"assoc_const\" | ||
pub const CONSTANT: usize = 0; | ||
} | ||
|
||
pub trait EasyToImpl { | ||
// @has - "$.index[*][?(@.name=='ToDeclare')].kind" \"assoc_type\" | ||
// @has - "$.index[*][?(@.name=='ToDeclare')].inner.default" null | ||
type ToDeclare; | ||
// @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].kind" \"assoc_const\" | ||
// @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.default" null | ||
const AN_ATTRIBUTE: usize; | ||
} | ||
|
||
impl EasyToImpl for Simple { | ||
// @has - "$.index[*][?(@.name=='ToDeclare')].inner.default.kind" \"primitive\" | ||
// @has - "$.index[*][?(@.name=='ToDeclare')].inner.default.inner" \"usize\" | ||
type ToDeclare = usize; | ||
// @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.type.kind" \"primitive\" | ||
// @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.type.inner" \"usize\" | ||
// @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.default" \"12\" | ||
const AN_ATTRIBUTE: usize = 12; | ||
} |