{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/37500","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/37500/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/37500/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/37500/events","html_url":"https://github.com/rust-lang/rust/issues/37500","id":186338973,"number":37500,"title":"Misleading docs for an enum with struct variants","user":{"login":"mathstuf","id":97253,"avatar_url":"https://avatars.githubusercontent.com/u/97253?v=3","gravatar_id":"","url":"https://api.github.com/users/mathstuf","html_url":"https://github.com/mathstuf","followers_url":"https://api.github.com/users/mathstuf/followers","following_url":"https://api.github.com/users/mathstuf/following{/other_user}","gists_url":"https://api.github.com/users/mathstuf/gists{/gist_id}","starred_url":"https://api.github.com/users/mathstuf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathstuf/subscriptions","organizations_url":"https://api.github.com/users/mathstuf/orgs","repos_url":"https://api.github.com/users/mathstuf/repos","events_url":"https://api.github.com/users/mathstuf/events{/privacy}","received_events_url":"https://api.github.com/users/mathstuf/received_events","type":"User","site_admin":false},"labels":[{"id":203738,"url":"https://api.github.com/repos/rust-lang/rust/labels/A-rustdoc","name":"A-rustdoc","color":"d7e102","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-31T17:01:07Z","updated_at":"2016-11-11T20:55:41Z","closed_at":null,"body":"Given this structure:\r\n\r\n```rust\r\npub enum OldTopicRemoval {\r\n    Obsoleted {\r\n        old_merge: StagedTopic,\r\n        replacement: Option<StagedTopic>,\r\n    },\r\n    Removed(StagedTopic),\r\n}\r\n```\r\n\r\nI'm seeing docs rendered as:\r\n\r\n![docs-enum](https://cloud.githubusercontent.com/assets/97253/19863197/9fa92942-9f69-11e6-99db-38b755cad90a.png)\r\n\r\nWhich makes it look like `Removed` is more closely related to the fields of `Obsoleted` rather than on the same level. It'd be nice if the fields for the `Obsoleted` variant fields were either indented somehow or collapsed with the description."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/260053460","html_url":"https://github.com/rust-lang/rust/issues/37500#issuecomment-260053460","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/37500","id":260053460,"user":{"login":"mathstuf","id":97253,"avatar_url":"https://avatars.githubusercontent.com/u/97253?v=3","gravatar_id":"","url":"https://api.github.com/users/mathstuf","html_url":"https://github.com/mathstuf","followers_url":"https://api.github.com/users/mathstuf/followers","following_url":"https://api.github.com/users/mathstuf/following{/other_user}","gists_url":"https://api.github.com/users/mathstuf/gists{/gist_id}","starred_url":"https://api.github.com/users/mathstuf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathstuf/subscriptions","organizations_url":"https://api.github.com/users/mathstuf/orgs","repos_url":"https://api.github.com/users/mathstuf/repos","events_url":"https://api.github.com/users/mathstuf/events{/privacy}","received_events_url":"https://api.github.com/users/mathstuf/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T20:55:41Z","updated_at":"2016-11-11T20:55:41Z","body":"This is probably too complicated, but Option 2 could have the following tweaks as well: for every subfield named the same, group them together (they're usually related anyways) and then list the variants it is a part of.\r\n\r\n```rust\r\nenum Animal {\r\n    Cat { name: String, lives: u8, },\r\n    Dog { name: String, breed: String, },\r\n}\r\n```\r\n\r\ncould render the `name` subfields together mentioning that it is part of both `Cat` and `Dog` while `lives`, and `breed` say they are only part of `Cat` and `Dog`, respectively. Rustdoc would probably need some directive/syntax for saying that a subfield's docstring should be shared though."}}
{"actor":{"display_login":"mathstuf"}}