{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/34222","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/34222/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/34222/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/34222/events","html_url":"https://github.com/rust-lang/rust/issues/34222","id":159780081,"number":34222,"title":"Internal Compiler Error running cargo doc","user":{"login":"AdamNiederer","id":4571394,"avatar_url":"https://avatars.githubusercontent.com/u/4571394?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamNiederer","html_url":"https://github.com/AdamNiederer","followers_url":"https://api.github.com/users/AdamNiederer/followers","following_url":"https://api.github.com/users/AdamNiederer/following{/other_user}","gists_url":"https://api.github.com/users/AdamNiederer/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamNiederer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamNiederer/subscriptions","organizations_url":"https://api.github.com/users/AdamNiederer/orgs","repos_url":"https://api.github.com/users/AdamNiederer/repos","events_url":"https://api.github.com/users/AdamNiederer/events{/privacy}","received_events_url":"https://api.github.com/users/AdamNiederer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/I-ICE","name":"I-ICE","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-06-11T16:01:42Z","updated_at":"2016-10-15T20:11:05Z","closed_at":null,"body":"Hey, I'm trying to learn Rust. I have this code. It's not valid Rust, but it causes the compiler to throw an ICE.\r\n```rust\r\nstruct Square {\r\n    xcoord :i32,\r\n    ycoord :i32,\r\n    len :i32\r\n}\r\n\r\nimpl Square {\r\n    fn area() {\r\n        len * len\r\n    }\r\n    fn diag() {\r\n        len * 2.sqrt()\r\n    }\r\n    fn quadr() {\r\n        match (xcoord, ycoord) {\r\n            -_ =>\r\n        }\r\n    }\r\n}\r\n\r\nfn main() {\r\n    /// Causes a crash\r\n    /// Example usage:\r\n    /// ```\r\n    /// main() #-> Causes crash\r\n    /// ```\r\n    let q = vec!(3, 2, 1);\r\n    let x = 5_000_000_i32;\r\n    let y = &x;\r\n    println!(\"Hello, world! {}\", q.len());\r\n    assert_eq!(q, [3, 2, 2]) // crashes\r\n}\r\n\r\n```\r\nI ran `cargo doc` on it, and was told to file a bug report. Running `cargo build` or `rustc main.rs` does not cause the panic.\r\n```\r\n[adam@AdamsPC src]$ RUST_BACKTRACE=1 cargo doc\r\n Documenting kek v0.1.0 (file:///home/adam/kek)\r\nmain.rs:16:14: 16:15 error: unexpected token: `_`\r\nmain.rs:16             -_ =>\r\n                        ^\r\nmain.rs:22:5: 22:37 error: attributes on non-item statements and expressions are experimental. (see issue #15701)\r\nmain.rs:22     /// Causes you to crash and shit\r\n               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nmain.rs:23:5: 23:23 error: attributes on non-item statements and expressions are experimental. (see issue #15701)\r\nmain.rs:23     /// Example usage:\r\n               ^~~~~~~~~~~~~~~~~~\r\nmain.rs:24:5: 24:12 error: attributes on non-item statements and expressions are experimental. (see issue #15701)\r\nmain.rs:24     /// ```\r\n               ^~~~~~~\r\nmain.rs:25:5: 25:32 error: attributes on non-item statements and expressions are experimental. (see issue #15701)\r\nmain.rs:25     /// main() #-> Causes crash\r\n               ^~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nmain.rs:26:5: 26:12 error: attributes on non-item statements and expressions are experimental. (see issue #15701)\r\nmain.rs:26     /// ```\r\n               ^~~~~~~\r\nerror: internal compiler error: unexpected panic\r\nnote: the compiler unexpectedly panicked. this is a bug.\r\nnote: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports\r\nnote: run with `RUST_BACKTRACE=1` for a backtrace\r\nthread 'rustc' panicked at 'phase_2_configure_and_expand aborted in rustdoc!: 5', src/libcore/result.rs:746\r\nstack backtrace:\r\n   1:     0x7efe3d4fa4e0 - std::sys::backtrace::tracing::imp::write::h4c73fcd3363076f5\r\n   2:     0x7efe3d507bdb - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::h0422dbb3077e6747\r\n   3:     0x7efe3d50777c - std::panicking::default_hook::haac48fa641db8fa2\r\n   4:     0x7efe3d4cc70f - std::sys_common::unwind::begin_unwind_inner::h39d40f52add53ef7\r\n   5:     0x7efe3d4ce7f8 - std::sys_common::unwind::begin_unwind_fmt::h64c0ff793199cc1b\r\n   6:     0x7efe3d4f7cf1 - rust_begin_unwind\r\n   7:     0x7efe3d5481af - core::panicking::panic_fmt::h73bf9d7e8e891a73\r\n   8:     0x7efe3da9b42b - core::result::unwrap_failed::h52d645c697d2a555\r\n   9:     0x7efe3da3637d - rustdoc::core::run_core::h5d51993c037675df\r\n  10:     0x7efe3da31c08 - std::sys_common::unwind::try::try_fn::he5d0ca3afe34ca3c\r\n  11:     0x7efe3d4f7c7b - __rust_try\r\n  12:     0x7efe3d4f7c0d - std::sys_common::unwind::inner_try::h9eebd8dc83f388a6\r\n  13:     0x7efe3da338ff - _<F as std..boxed..FnBox<A>>::call_box::h871bc6bfba8a323f\r\n  14:     0x7efe3d505d74 - std::sys::thread::Thread::new::thread_start::h471ad90789353b5b\r\n  15:     0x7efe36288473 - start_thread\r\n  16:     0x7efe3d15d69c - clone\r\n  17:                0x0 - <unknown>\r\n\r\nerror: Could not document `kek`.\r\n\r\nTo learn more, run the command again with --verbose.\r\n```\r\nHere's the `rustc` version. I pulled it down from the Arch repositories yesterday.\r\n```\r\nrustc 1.9.0\r\nbinary: rustc\r\ncommit-hash: unknown\r\ncommit-date: unknown\r\nhost: x86_64-unknown-linux-gnu\r\nrelease: 1.9.0\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/254008189","html_url":"https://github.com/rust-lang/rust/issues/34222#issuecomment-254008189","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/34222","id":254008189,"user":{"login":"zackmdavis","id":1076988,"avatar_url":"https://avatars.githubusercontent.com/u/1076988?v=3","gravatar_id":"","url":"https://api.github.com/users/zackmdavis","html_url":"https://github.com/zackmdavis","followers_url":"https://api.github.com/users/zackmdavis/followers","following_url":"https://api.github.com/users/zackmdavis/following{/other_user}","gists_url":"https://api.github.com/users/zackmdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/zackmdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zackmdavis/subscriptions","organizations_url":"https://api.github.com/users/zackmdavis/orgs","repos_url":"https://api.github.com/users/zackmdavis/repos","events_url":"https://api.github.com/users/zackmdavis/events{/privacy}","received_events_url":"https://api.github.com/users/zackmdavis/received_events","type":"User","site_admin":false},"created_at":"2016-10-15T20:11:05Z","updated_at":"2016-10-15T20:11:05Z","body":"This looks like it might be fixed now (ordinary error instead of ICE)?\r\n\r\n```\r\n$ cat src/main.rs \r\nfn main() {\r\n    /// crash\r\n    println!(\"{}\", \"Hello, world!\");\r\n}\r\n$ cargo build\r\n   Compiling example_project v0.1.0 (file:///home/ubuntu/example_project)\r\nerror: attributes on non-item statements and expressions are experimental. (see issue #15701)\r\n --> src/main.rs:2:5\r\n  |\r\n2 |     /// crash\r\n  |     ^^^^^^^^^\r\n\r\nerror: aborting due to previous error\r\n\r\nerror: Could not compile `example_project`.\r\n\r\nTo learn more, run the command again with --verbose.\r\n$ cargo doc\r\n Documenting example_project v0.1.0 (file:///home/ubuntu/example_project)\r\nerror: attributes on non-item statements and expressions are experimental. (see issue #15701)\r\n --> src/main.rs:2:5\r\n  |\r\n2 |     /// crash\r\n  |     ^^^^^^^^^\r\n\r\nerror: Compilation failed, aborting rustdoc\r\n\r\nerror: Could not document `example_project`.\r\n\r\nTo learn more, run the command again with --verbose.\r\n$\r\n```"}}
{"actor":{"display_login":"zackmdavis"}}