{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/31722","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/31722/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/31722/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/31722/events","html_url":"https://github.com/rust-lang/rust/issues/31722","id":134171998,"number":31722,"title":"`rustc --pretty normal` generates bad code with top level struct doc comments","user":{"login":"erickt","id":84711,"avatar_url":"https://avatars.githubusercontent.com/u/84711?v=3","gravatar_id":"","url":"https://api.github.com/users/erickt","html_url":"https://github.com/erickt","followers_url":"https://api.github.com/users/erickt/followers","following_url":"https://api.github.com/users/erickt/following{/other_user}","gists_url":"https://api.github.com/users/erickt/gists{/gist_id}","starred_url":"https://api.github.com/users/erickt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erickt/subscriptions","organizations_url":"https://api.github.com/users/erickt/orgs","repos_url":"https://api.github.com/users/erickt/repos","events_url":"https://api.github.com/users/erickt/events{/privacy}","received_events_url":"https://api.github.com/users/erickt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-pretty","name":"A-pretty","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-17T04:08:35Z","updated_at":"2016-02-17T17:48:48Z","closed_at":"2016-02-17T17:48:48Z","body":"This code:\r\n\r\n```rust\r\n/// blarg\r\nstruct Foo {\r\n    x: usize,\r\n}\r\n\r\nfn main() {}\r\n```\r\n\r\nWhen run with `rustc -Z unstable-options --pretty normal foo.rs` produces this invalid code because it's losing a newline:\r\n\r\n```rust\r\n/// blargstruct Foo {\r\n             x: usize,\r\n         }\r\n\r\nfn main() { }\r\n```\r\n\r\nWith `rustc -Z unstable-options --pretty expanded foo.rs`, however, it produces this syntactically correct code:\r\n\r\n```rust\r\n#![feature(prelude_import)]\r\n#![no_std]\r\n#[prelude_import]\r\nuse std::prelude::v1::*;\r\n#[macro_use]\r\nextern crate std as std;\r\n/// blarg\r\nstruct Foo {\r\n    x: usize,\r\n}\r\n\r\nfn main() { }\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/185322866","html_url":"https://github.com/rust-lang/rust/issues/31722#issuecomment-185322866","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/31722","id":185322866,"user":{"login":"erickt","id":84711,"avatar_url":"https://avatars.githubusercontent.com/u/84711?v=3","gravatar_id":"","url":"https://api.github.com/users/erickt","html_url":"https://github.com/erickt","followers_url":"https://api.github.com/users/erickt/followers","following_url":"https://api.github.com/users/erickt/following{/other_user}","gists_url":"https://api.github.com/users/erickt/gists{/gist_id}","starred_url":"https://api.github.com/users/erickt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erickt/subscriptions","organizations_url":"https://api.github.com/users/erickt/orgs","repos_url":"https://api.github.com/users/erickt/repos","events_url":"https://api.github.com/users/erickt/events{/privacy}","received_events_url":"https://api.github.com/users/erickt/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T17:48:48Z","updated_at":"2016-02-17T17:48:48Z","body":"Moving this bug over to syntex: https://github.com/serde-rs/syntex/issues/31."}}