{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/27072","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/27072/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/27072/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/27072/events","html_url":"https://github.com/rust-lang/rust/issues/27072","id":95500794,"number":27072,"title":"Compiler panicked","user":{"login":"azerupi","id":7647338,"avatar_url":"https://avatars.githubusercontent.com/u/7647338?v=3","gravatar_id":"","url":"https://api.github.com/users/azerupi","html_url":"https://github.com/azerupi","followers_url":"https://api.github.com/users/azerupi/followers","following_url":"https://api.github.com/users/azerupi/following{/other_user}","gists_url":"https://api.github.com/users/azerupi/gists{/gist_id}","starred_url":"https://api.github.com/users/azerupi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azerupi/subscriptions","organizations_url":"https://api.github.com/users/azerupi/orgs","repos_url":"https://api.github.com/users/azerupi/repos","events_url":"https://api.github.com/users/azerupi/events{/privacy}","received_events_url":"https://api.github.com/users/azerupi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-16T18:51:09Z","updated_at":"2015-07-16T18:54:07Z","closed_at":null,"body":"I got the compiler to panic. Here is the **backtrace**:\r\n\r\n```\r\n$ RUST_BACKTRACE=1 cargo build\r\n   Compiling mdbook v0.0.1 (file:///home/mathieu/Programming/Rust/mdbook)\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\nthread 'rustc' panicked at 'fold_mac disabled by default', ../src/libsyntax/fold.rs:190\r\n\r\nstack backtrace:\r\n   1:     0x7f8f9d556c8e - sys::backtrace::write::hba0090c65dc9b973kqs\r\n   2:     0x7f8f9d55eb34 - panicking::on_panic::ha888d43548c7ef7dU7w\r\n   3:     0x7f8f9d52168e - rt::unwind::begin_unwind_inner::h6c07c3faf8145c2ayNw\r\n   4:     0x7f8f9a83aba1 - rt::unwind::begin_unwind::h61311074365208902\r\n   5:     0x7f8f9aa98c31 - ptr::P<T>::map::h4262623173329566783\r\n   6:     0x7f8f9aa8953e - ext::expand::expand_expr::closure.64692\r\n   7:     0x7f8f9aa87344 - ext::expand::expand_expr::h5d16b298ec3e6d44S3a\r\n   8:     0x7f8f9aad6e3b - fold::noop_fold_stmt::h2830177968221966586\r\n   9:     0x7f8f9aab2f01 - ext::expand::expand_stmt::ha540a83711e3b587zEb\r\n  10:     0x7f8f9aadf7d3 - ext::expand::expand_block_elts::closure.65399\r\n  11:     0x7f8f9aadf4cc - iter::FlatMap<I, U, F>.Iterator::next::h15931703869202550713\r\n  12:     0x7f8f9aade2b7 - vec::Vec<T>.FromIterator<T>::from_iter::h17304921018562427167\r\n  13:     0x7f8f9aadd873 - ext::expand::expand_block_elts::closure.65393\r\n  14:     0x7f8f9aa9a5d6 - ext::expand::expand_block_elts::hdc0f023594f31dbdvPb\r\n  15:     0x7f8f9aadd57d - ext::expand::expand_block::h154763b840e3f863QOb\r\n  16:     0x7f8f9aa9a004 - ext::expand::expand_and_rename_fn_decl_and_block::he58b2e30da928a59Uic\r\n  17:     0x7f8f9ab05525 - ext::expand::expand_and_rename_method::he352edb1d6a5af96ekc\r\n  18:     0x7f8f9ab0a1cf - ext::expand::expand_impl_item::closure.65811\r\n  19:     0x7f8f9ab06c7f - ext::expand::expand_impl_item::hc5ab3bcbf3bfabe2Dfc\r\n  20:     0x7f8f9aa9db5e - ext::expand::expand_annotatable::h347111f998e00452RZb\r\n  21:     0x7f8f9aaacca5 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_impl_item::h4b925cb3f2b4ecddKnc\r\n  22:     0x7f8f9aaac77d - iter::FlatMap<I, U, F>.Iterator::next::h10775116680282487154\r\n  23:     0x7f8f9aaaca53 - vec::Vec<T>::extend_desugared::h16127363502739536117\r\n  24:     0x7f8f9aaab6bf - iter::Iterator::collect::h10569062580348617273\r\n  25:     0x7f8f9aaa2597 - ext::expand::expand_item_underscore::h1ae9e40d706a69f4Zsb\r\n  26:     0x7f8f9ab047bd - fold::Folder::fold_item_simple::h13015839913330126400\r\n  27:     0x7f8f9ab043f4 - ptr::P<T>::map::h5783195092218359557\r\n  28:     0x7f8f9aa9e6c6 - ext::expand::expand_annotatable::h347111f998e00452RZb\r\n  29:     0x7f8f9aa9a728 - ext::expand::expand_item::h3529ff04c83295ccosb\r\n  30:     0x7f8f9aaa721e - iter::FlatMap<I, U, F>.Iterator::next::h3067849998977955174\r\n  31:     0x7f8f9aaa6007 - vec::Vec<T>.FromIterator<T>::from_iter::h17852130624423508185\r\n  32:     0x7f8f9aaa573c - fold::noop_fold_mod::h8231944226184386280\r\n  33:     0x7f8f9aaa1955 - ext::expand::expand_item_underscore::h1ae9e40d706a69f4Zsb\r\n  34:     0x7f8f9ab047bd - fold::Folder::fold_item_simple::h13015839913330126400\r\n  35:     0x7f8f9ab043f4 - ptr::P<T>::map::h5783195092218359557\r\n  36:     0x7f8f9aa9f127 - ext::expand::expand_annotatable::h347111f998e00452RZb\r\n  37:     0x7f8f9aa9a728 - ext::expand::expand_item::h3529ff04c83295ccosb\r\n  38:     0x7f8f9aaa721e - iter::FlatMap<I, U, F>.Iterator::next::h3067849998977955174\r\n  39:     0x7f8f9aaa5cf4 - vec::Vec<T>.FromIterator<T>::from_iter::h17852130624423508185\r\n  40:     0x7f8f9aaa573c - fold::noop_fold_mod::h8231944226184386280\r\n  41:     0x7f8f9aaa1955 - ext::expand::expand_item_underscore::h1ae9e40d706a69f4Zsb\r\n  42:     0x7f8f9ab047bd - fold::Folder::fold_item_simple::h13015839913330126400\r\n  43:     0x7f8f9ab043f4 - ptr::P<T>::map::h5783195092218359557\r\n  44:     0x7f8f9aa9f127 - ext::expand::expand_annotatable::h347111f998e00452RZb\r\n  45:     0x7f8f9aa9a728 - ext::expand::expand_item::h3529ff04c83295ccosb\r\n  46:     0x7f8f9aaa721e - iter::FlatMap<I, U, F>.Iterator::next::h3067849998977955174\r\n  47:     0x7f8f9aaa6007 - vec::Vec<T>.FromIterator<T>::from_iter::h17852130624423508185\r\n  48:     0x7f8f9aaa573c - fold::noop_fold_mod::h8231944226184386280\r\n  49:     0x7f8f9aaa1955 - ext::expand::expand_item_underscore::h1ae9e40d706a69f4Zsb\r\n  50:     0x7f8f9ab047bd - fold::Folder::fold_item_simple::h13015839913330126400\r\n  51:     0x7f8f9ab043f4 - ptr::P<T>::map::h5783195092218359557\r\n  52:     0x7f8f9aa9f127 - ext::expand::expand_annotatable::h347111f998e00452RZb\r\n  53:     0x7f8f9aa9a728 - ext::expand::expand_item::h3529ff04c83295ccosb\r\n  54:     0x7f8f9ab0d5b9 - ext::expand::expand_crate::hffd65e9f8234e652prc\r\n  55:     0x7f8f9daf3a1d - driver::phase_2_configure_and_expand::closure.21446\r\n  56:     0x7f8f9daa56dc - driver::phase_2_configure_and_expand::h6227118d5a2dbd5dita\r\n  57:     0x7f8f9da94a3a - driver::compile_input::ha9b5fd65b77d50f6Tba\r\n  58:     0x7f8f9db72863 - run_compiler::h240fdc5369e0b898x7b\r\n  59:     0x7f8f9db7023e - boxed::F.FnBox<A>::call_box::h17338777036410156156\r\n  60:     0x7f8f9db6fa89 - rt::unwind::try::try_fn::h2295644814600911096\r\n  61:     0x7f8f9d5d6d38 - rust_try_inner\r\n  62:     0x7f8f9d5d6d25 - rust_try\r\n  63:     0x7f8f9d549ee7 - rt::unwind::try::inner_try::h3a5b73fc117bcddfrJw\r\n  64:     0x7f8f9db6fc9b - boxed::F.FnBox<A>::call_box::h803341546616928030\r\n  65:     0x7f8f9d55d791 - sys::thread::Thread::new::thread_start::h780a1f33992577dcoTv\r\n  66:     0x7f8f97bef353 - start_thread\r\n  67:     0x7f8f9d1b8bfc - __clone\r\n  68:                0x0 - <unknown>\r\n\r\n```\r\n\r\n**This is the part of my code that made the compiler panic:**\r\n\r\n```rust\r\nfn parse_summary(&mut self) -> Result<()> {\r\n        let summary = BufReader::new(try!(File::open(self.config.src().join(\"SUMMARY.md\"))));\r\n\r\n        let mut level = -1;\r\n        for try!(line) in summary.lines() {\r\n            let indent = utilities::indent(&line, 4);\r\n\r\n            // If the difference between the current level and the indent level is greater than\r\n            // one then there is a syntax error in SUMMARY.md\r\n            /*if i32::abs(level - indent) > 1 {\r\n                return Error::new(ErrorKind::Other,\"Indentation error in SUMMARY.md at line:\\n\\n\")\r\n            }*/\r\n        }\r\n        \r\n        Ok(())\r\n    }\r\n```\r\n\r\nIf I comment out the body of the function it works.\r\n\r\n**Info about my machine:**\r\n```\r\nArch Linux\r\ncargo 0.3.0-nightly (a2dd2ac 2015-06-24) (built 2015-06-23)\r\nrustc 1.2.0-beta.1 (2ad26e850 2015-06-23)\r\n```\r\n\r\n**I am not sure what info you need, so tell me if I forgot something or you want more code.**"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/122049525","html_url":"https://github.com/rust-lang/rust/issues/27072#issuecomment-122049525","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/27072","id":122049525,"user":{"login":"azerupi","id":7647338,"avatar_url":"https://avatars.githubusercontent.com/u/7647338?v=3","gravatar_id":"","url":"https://api.github.com/users/azerupi","html_url":"https://github.com/azerupi","followers_url":"https://api.github.com/users/azerupi/followers","following_url":"https://api.github.com/users/azerupi/following{/other_user}","gists_url":"https://api.github.com/users/azerupi/gists{/gist_id}","starred_url":"https://api.github.com/users/azerupi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azerupi/subscriptions","organizations_url":"https://api.github.com/users/azerupi/orgs","repos_url":"https://api.github.com/users/azerupi/repos","events_url":"https://api.github.com/users/azerupi/events{/privacy}","received_events_url":"https://api.github.com/users/azerupi/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T18:54:07Z","updated_at":"2015-07-16T18:54:07Z","body":"Seems to be caused by the `try!()` in the for loop."}}