Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: internal compiler error: librustc_mir/hair/pattern/mod.rs:514: tuple struct pattern not applied to an ADT #50582

Closed
vegard opened this issue May 9, 2018 · 2 comments · Fixed by #58921
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@vegard
Copy link

vegard commented May 9, 2018

Input:

fn main() {
    Vec::<[(); 1 + for x in 0..1 {}]>::new();
}

Output:

$ rustc -Z external-macro-backtrace -
error[E0277]: cannot add `()` to `{integer}`
 --> <anon>:2:18
  |
2 |     Vec::<[(); 1 + for x in 0..1 {}]>::new();
  |                  ^ no implementation for `{integer} + ()`
  |
  = help: the trait `std::ops::Add<()>` is not implemented for `{integer}`

error: internal compiler error: librustc_mir/hair/pattern/mod.rs:514: tuple struct pattern not applied to an ADT
 --> <anon>:2:24
  |
2 |     Vec::<[(); 1 + for x in 0..1 {}]>::new();
  |                        ^

thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:499:9
stack backtrace:
...
  13: rustc::session::span_bug_fmt
             at /home/vegard/rust/src/librustc/session/mod.rs:1267
  14: rustc_mir::hair::pattern::PatternContext::lower_pattern
             at librustc_mir/hair/pattern/mod.rs:514
             at librustc_mir/hair/pattern/mod.rs:344
  15: rustc_mir::hair::pattern::check_match::MatchVisitor::check_match::{{closure}}
             at librustc_mir/hair/pattern/check_match.rs:202
             at /home/vegard/rust/src/libcore/ops/function.rs:271
             at /home/vegard/rust/src/libcore/option.rs:404
             at /home/vegard/rust/src/libcore/iter/mod.rs:1347
             at /home/vegard/rust/src/liballoc/vec.rs:1883
             at /home/vegard/rust/src/liballoc/vec.rs:1866
             at /home/vegard/rust/src/liballoc/vec.rs:1752
             at /home/vegard/rust/src/libcore/iter/iterator.rs:1375
             at librustc_mir/hair/pattern/check_match.rs:198
             at /home/vegard/rust/src/libcore/ops/function.rs:271
             at /home/vegard/rust/src/libcore/option.rs:404
             at /home/vegard/rust/src/libcore/iter/mod.rs:1347
             at /home/vegard/rust/src/liballoc/vec.rs:1883
             at /home/vegard/rust/src/liballoc/vec.rs:1866
             at /home/vegard/rust/src/liballoc/vec.rs:1752
             at /home/vegard/rust/src/libcore/iter/iterator.rs:1375
             at librustc_mir/hair/pattern/check_match.rs:197
...
Complete output
$ rustc -Z external-macro-backtrace -
error[E0277]: cannot add `()` to `{integer}`
 --> <anon>:2:18
  |
2 |     Vec::<[(); 1 + for x in 0..1 {}]>::new();
  |                  ^ no implementation for `{integer} + ()`
  |
  = help: the trait `std::ops::Add<()>` is not implemented for `{integer}`

error: internal compiler error: librustc_mir/hair/pattern/mod.rs:514: tuple struct pattern not applied to an ADT
 --> <anon>:2:24
  |
2 |     Vec::<[(); 1 + for x in 0..1 {}]>::new();
  |                        ^

thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:499:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
             at librustc/util/common.rs:54
   5: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:467
   6: std::panicking::begin_panic
             at /home/vegard/rust/src/libstd/panicking.rs:397
   7: rustc_errors::Handler::span_bug
             at /home/vegard/rust/src/<panic macros>:3
   8: rustc::session::opt_span_bug_fmt::{{closure}}
             at /home/vegard/rust/src/librustc/session/mod.rs:1279
   9: rustc::ty::context::tls::with_opt::{{closure}}
             at /home/vegard/rust/src/librustc/ty/context.rs:1943
  10: rustc::ty::context::tls::with_context_opt
             at /home/vegard/rust/src/librustc/ty/context.rs:1880
  11: rustc::ty::context::tls::with_opt
             at /home/vegard/rust/src/librustc/ty/context.rs:1943
  12: rustc::session::opt_span_bug_fmt
             at /home/vegard/rust/src/librustc/session/mod.rs:1276
  13: rustc::session::span_bug_fmt
             at /home/vegard/rust/src/librustc/session/mod.rs:1267
  14: rustc_mir::hair::pattern::PatternContext::lower_pattern
             at librustc_mir/hair/pattern/mod.rs:514
             at librustc_mir/hair/pattern/mod.rs:344
  15: rustc_mir::hair::pattern::check_match::MatchVisitor::check_match::{{closure}}
             at librustc_mir/hair/pattern/check_match.rs:202
             at /home/vegard/rust/src/libcore/ops/function.rs:271
             at /home/vegard/rust/src/libcore/option.rs:404
             at /home/vegard/rust/src/libcore/iter/mod.rs:1347
             at /home/vegard/rust/src/liballoc/vec.rs:1883
             at /home/vegard/rust/src/liballoc/vec.rs:1866
             at /home/vegard/rust/src/liballoc/vec.rs:1752
             at /home/vegard/rust/src/libcore/iter/iterator.rs:1375
             at librustc_mir/hair/pattern/check_match.rs:198
             at /home/vegard/rust/src/libcore/ops/function.rs:271
             at /home/vegard/rust/src/libcore/option.rs:404
             at /home/vegard/rust/src/libcore/iter/mod.rs:1347
             at /home/vegard/rust/src/liballoc/vec.rs:1883
             at /home/vegard/rust/src/liballoc/vec.rs:1866
             at /home/vegard/rust/src/liballoc/vec.rs:1752
             at /home/vegard/rust/src/libcore/iter/iterator.rs:1375
             at librustc_mir/hair/pattern/check_match.rs:197
  16: <rustc_mir::hair::pattern::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
             at librustc_mir/hair/pattern/_match.rs:166
             at librustc_mir/hair/pattern/check_match.rs:194
             at librustc_mir/hair/pattern/check_match.rs:102
  17: <rustc_mir::hair::pattern::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:935
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:264
             at /home/vegard/rust/src/<walk_list macros>:2
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:261
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:1005
             at librustc_mir/hair/pattern/check_match.rs:98
  18: <rustc_mir::hair::pattern::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:267
             at /home/vegard/rust/src/<walk_list macros>:2
             at librustc_mir/hair/pattern/check_match.rs:98
  19: <rustc_mir::hair::pattern::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_local
             at /home/vegard/rust/src/<walk_list macros>:2
             at librustc_mir/hair/pattern/check_match.rs:109
  20: <rustc_mir::hair::pattern::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:942
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:273
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:930
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:264
             at /home/vegard/rust/src/<walk_list macros>:2
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:261
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:1018
             at librustc_mir/hair/pattern/check_match.rs:98
  21: <rustc_mir::hair::pattern::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
             at /home/vegard/rust/src/libsyntax/ptr.rs:0
  22: <rustc_mir::hair::pattern::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
             at /home/vegard/rust/src/librustc/hir/intravisit.rs:400
             at librustc_mir/hair/pattern/check_match.rs:121
  23: rustc_mir::hair::pattern::check_match::check_match
             at librustc_mir/hair/pattern/check_match.rs:70
             at /home/vegard/rust/src/librustc/session/mod.rs:318
             at librustc_mir/hair/pattern/check_match.rs:69
  24: rustc::dep_graph::graph::DepGraph::with_task_impl
             at librustc/ty/maps/plumbing.rs:723
             at librustc/dep_graph/graph.rs:343
  25: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at librustc/dep_graph/graph.rs:209
             at librustc/ty/maps/plumbing.rs:530
             at librustc/ty/maps/plumbing.rs:200
             at librustc/ty/context.rs:1844
             at librustc/ty/context.rs:1787
             at librustc/ty/context.rs:1843
             at librustc/ty/maps/plumbing.rs:199
             at librustc/ty/context.rs:1905
             at librustc/ty/context.rs:1889
             at librustc/ty/context.rs:1880
             at librustc/ty/context.rs:1889
             at librustc/ty/context.rs:1900
             at librustc/ty/maps/plumbing.rs:189
             at librustc/ty/maps/plumbing.rs:523
  26: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
             at librustc/ty/maps/plumbing.rs:372
             at librustc/ty/maps/plumbing.rs:599
             at librustc/ty/maps/plumbing.rs:606
  27: rustc_mir::interpret::const_eval::const_eval_provider
             at librustc_mir/interpret/const_eval.rs:451
  28: rustc::dep_graph::graph::DepGraph::with_task_impl
             at librustc/ty/maps/plumbing.rs:723
             at librustc/dep_graph/graph.rs:343
  29: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at librustc/dep_graph/graph.rs:209
             at librustc/ty/maps/plumbing.rs:530
             at librustc/ty/maps/plumbing.rs:200
             at librustc/ty/context.rs:1844
             at librustc/ty/context.rs:1787
             at librustc/ty/context.rs:1843
             at librustc/ty/maps/plumbing.rs:199
             at librustc/ty/context.rs:1905
             at librustc/ty/context.rs:1889
             at librustc/ty/context.rs:1880
             at librustc/ty/context.rs:1889
             at librustc/ty/context.rs:1900
             at librustc/ty/maps/plumbing.rs:189
             at librustc/ty/maps/plumbing.rs:523
  30: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_query
             at librustc/ty/maps/plumbing.rs:372
             at librustc/ty/maps/plumbing.rs:599
  31: <rustc::traits::project::AssociatedTypeNormalizer<'a, 'b, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_const
             at librustc/ty/maps/plumbing.rs:606
             at librustc/ty/maps/plumbing.rs:776
             at librustc/ty/maps/plumbing.rs:769
             at librustc/traits/project.rs:436
  32: <rustc::traits::project::AssociatedTypeNormalizer<'a, 'b, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
             at librustc/ty/structural_impls.rs:1176
             at librustc/ty/structural_impls.rs:857
             at librustc/traits/project.rs:346
  33: rustc_typeck::check::Inherited::normalize_associated_types_in
             at /home/vegard/rust/src/librustc/ty/structural_impls.rs:890
             at /home/vegard/rust/src/librustc/traits/project.rs:324
             at /home/vegard/rust/src/librustc/traits/project.rs:283
             at /home/vegard/rust/src/librustc/traits/project.rs:267
             at /home/vegard/rust/src/librustc/infer/mod.rs:1358
             at librustc_typeck/check/mod.rs:677
  34: <rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx> as rustc_typeck::astconv::AstConv<'gcx, 'tcx>>::normalize_ty
             at librustc_typeck/check/mod.rs:2075
             at librustc_typeck/check/mod.rs:1776
  35: <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::ast_ty_to_ty
             at librustc_typeck/astconv.rs:1095
  36: <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::create_substs_for_ast_path::{{closure}}
             at librustc_typeck/astconv.rs:261
  37: rustc::ty::subst::<impl rustc::ty::Slice<rustc::ty::subst::Kind<'tcx>>>::fill_item
             at /home/vegard/rust/src/librustc/ty/subst.rs:260
             at /home/vegard/rust/src/librustc/ty/subst.rs:235
  38: <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::create_substs_for_ast_path
             at /home/vegard/rust/src/librustc/ty/subst.rs:203
             at librustc_typeck/astconv.rs:243
  39: <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::ast_path_substs_for_ty
             at librustc_typeck/astconv.rs:176
             at /home/vegard/rust/src/librustc/hir/mod.rs:366
             at librustc_typeck/astconv.rs:175
  40: <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::def_to_ty
             at librustc_typeck/astconv.rs:555
             at librustc_typeck/astconv.rs:964
  41: <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::ast_ty_to_ty
             at librustc_typeck/astconv.rs:1074
  42: rustc_typeck::check::FnCtxt::resolve_ty_and_def_ufcs
             at librustc_typeck/check/mod.rs:2119
             at librustc_typeck/check/mod.rs:4183
  43: rustc_typeck::check::FnCtxt::check_expr_kind
             at librustc_typeck/check/mod.rs:3698
  44: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
             at librustc_typeck/check/mod.rs:3530
  45: rustc_typeck::check::FnCtxt::check_expr_kind
             at librustc_typeck/check/mod.rs:2864
             at librustc_typeck/check/mod.rs:2868
             at librustc_typeck/check/callee.rs:51
             at librustc_typeck/check/mod.rs:3916
  46: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
             at librustc_typeck/check/mod.rs:3530
  47: rustc_typeck::check::FnCtxt::check_block_with_expected::{{closure}}
             at librustc_typeck/check/mod.rs:2864
             at librustc_typeck/check/mod.rs:2868
             at librustc_typeck/check/mod.rs:4296
             at librustc_typeck/check/mod.rs:4361
  48: rustc_typeck::check::FnCtxt::check_block_with_expected
             at librustc_typeck/check/mod.rs:5070
             at librustc_typeck/check/mod.rs:4359
  49: rustc_typeck::check::FnCtxt::check_expr_kind
             at librustc_typeck/check/mod.rs:3913
  50: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
             at librustc_typeck/check/mod.rs:3530
  51: rustc_typeck::check::FnCtxt::check_return_expr
             at librustc_typeck/check/mod.rs:2864
             at librustc_typeck/check/mod.rs:2858
             at librustc_typeck/check/mod.rs:2996
  52: rustc_typeck::check::check_fn
             at librustc_typeck/check/mod.rs:1081
  53: rustc_typeck::check::typeck_tables_of::{{closure}}
             at librustc_typeck/check/mod.rs:871
  54: rustc_typeck::check::typeck_tables_of
             at librustc_typeck/check/mod.rs:617
             at /home/vegard/rust/src/librustc/infer/mod.rs:453
             at /home/vegard/rust/src/librustc/ty/context.rs:1578
             at /home/vegard/rust/src/librustc/ty/context.rs:1844
             at /home/vegard/rust/src/librustc/ty/context.rs:1787
             at /home/vegard/rust/src/librustc/ty/context.rs:1843
             at /home/vegard/rust/src/librustc/ty/context.rs:1577
             at /home/vegard/rust/src/librustc/ty/context.rs:1905
             at /home/vegard/rust/src/librustc/ty/context.rs:1889
             at /home/vegard/rust/src/librustc/ty/context.rs:1880
             at /home/vegard/rust/src/librustc/ty/context.rs:1889
             at /home/vegard/rust/src/librustc/ty/context.rs:1900
             at /home/vegard/rust/src/librustc/ty/context.rs:1570
             at /home/vegard/rust/src/librustc/infer/mod.rs:453
             at librustc_typeck/check/mod.rs:617
             at librustc_typeck/check/mod.rs:855
  55: rustc::dep_graph::graph::DepGraph::with_task_impl
             at librustc/ty/maps/plumbing.rs:723
             at librustc/dep_graph/graph.rs:343
  56: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at librustc/dep_graph/graph.rs:209
             at librustc/ty/maps/plumbing.rs:530
             at librustc/ty/maps/plumbing.rs:200
             at librustc/ty/context.rs:1844
             at librustc/ty/context.rs:1787
             at librustc/ty/context.rs:1843
             at librustc/ty/maps/plumbing.rs:199
             at librustc/ty/context.rs:1905
             at librustc/ty/context.rs:1889
             at librustc/ty/context.rs:1880
             at librustc/ty/context.rs:1889
             at librustc/ty/context.rs:1900
             at librustc/ty/maps/plumbing.rs:189
             at librustc/ty/maps/plumbing.rs:523
  57: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
             at librustc/ty/maps/plumbing.rs:372
             at librustc/ty/maps/plumbing.rs:599
             at librustc/ty/maps/plumbing.rs:606
  58: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::ensure
             at librustc/ty/maps/plumbing.rs:574
             at librustc/ty/maps/plumbing.rs:740
  59: rustc_typeck::check::typeck_item_bodies
             at librustc_typeck/check/mod.rs:715
             at /home/vegard/rust/src/librustc/session/mod.rs:318
             at librustc_typeck/check/mod.rs:713
  60: rustc::dep_graph::graph::DepGraph::with_task_impl
             at librustc/ty/maps/plumbing.rs:723
             at librustc/dep_graph/graph.rs:343
  61: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at librustc/dep_graph/graph.rs:209
             at librustc/ty/maps/plumbing.rs:530
             at librustc/ty/maps/plumbing.rs:200
             at librustc/ty/context.rs:1844
             at librustc/ty/context.rs:1787
             at librustc/ty/context.rs:1843
             at librustc/ty/maps/plumbing.rs:199
             at librustc/ty/context.rs:1905
             at librustc/ty/context.rs:1889
             at librustc/ty/context.rs:1880
             at librustc/ty/context.rs:1889
             at librustc/ty/context.rs:1900
             at librustc/ty/maps/plumbing.rs:189
             at librustc/ty/maps/plumbing.rs:523
  62: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
             at librustc/ty/maps/plumbing.rs:372
             at librustc/ty/maps/plumbing.rs:599
             at librustc/ty/maps/plumbing.rs:606
  63: rustc_typeck::check_crate
             at librustc_typeck/check/mod.rs:706
             at librustc_typeck/lib.rs:344
             at /home/vegard/rust/src/librustc/util/common.rs:166
             at /home/vegard/rust/src/librustc/util/common.rs:160
             at librustc_typeck/lib.rs:344
  64: rustc::ty::context::TyCtxt::create_and_enter
             at librustc_driver/driver.rs:1121
             at /home/vegard/rust/src/librustc/ty/context.rs:1867
             at /home/vegard/rust/src/librustc/ty/context.rs:1844
             at /home/vegard/rust/src/librustc/ty/context.rs:1787
             at /home/vegard/rust/src/librustc/ty/context.rs:1843
             at /home/vegard/rust/src/librustc/ty/context.rs:1866
             at /home/vegard/rust/src/librustc/ty/context.rs:1833
             at /home/vegard/rust/src/libstd/thread/local.rs:294
             at /home/vegard/rust/src/libstd/thread/local.rs:248
             at /home/vegard/rust/src/librustc/ty/context.rs:1825
             at /home/vegard/rust/src/libstd/thread/local.rs:294
             at /home/vegard/rust/src/libstd/thread/local.rs:248
             at /home/vegard/rust/src/librustc/ty/context.rs:1817
             at /home/vegard/rust/src/librustc/ty/context.rs:1855
             at /home/vegard/rust/src/librustc/ty/context.rs:1299
  65: rustc_driver::driver::compile_input
             at librustc_driver/driver.rs:1095
             at librustc_driver/driver.rs:231
  66: rustc_driver::run_compiler
             at librustc_driver/lib.rs:540
             at librustc_driver/lib.rs:457
             at /home/vegard/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/scoped-tls-0.1.1/src/lib.rs:155
             at /home/vegard/rust/src/libsyntax/lib.rs:97
             at /home/vegard/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/scoped-tls-0.1.1/src/lib.rs:155
             at /home/vegard/rust/src/libsyntax/lib.rs:96
             at librustc_driver/lib.rs:456
  67: rustc_driver::monitor::{{closure}}
             at librustc_driver/lib.rs:1684
             at librustc_driver/lib.rs:174
             at librustc_driver/lib.rs:1598
  68: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  69: rustc_driver::run
             at /home/vegard/rust/src/libstd/panicking.rs:289
             at /home/vegard/rust/src/libstd/panic.rs:374
             at librustc_driver/lib.rs:1530
             at librustc_driver/lib.rs:1597
             at librustc_driver/lib.rs:173
  70: rustc_driver::main
             at librustc_driver/lib.rs:1677
  71: std::rt::lang_start::{{closure}}
             at /home/vegard/rust/src/libstd/rt.rs:74
  72: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  73: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  74: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:374
             at libstd/rt.rs:58
  75: main
  76: __libc_start_main
  77: _start
query stack during panic:
#0 [check_match] processing `main::{{initializer}}`
#1 [const_eval] const-evaluating `main::{{initializer}}`
#2 [typeck_tables_of] processing `main`
#3 [typeck_item_bodies] type-checking all item bodies
end of query stack
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.27.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z external-macro-backtrace

I'm on commit c166b03.

@pietroalbini pietroalbini added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels May 9, 2018
@cuviper
Copy link
Member

cuviper commented Aug 16, 2018

This still ICEs on stable 1.28.0, but it looks fine on 1.29.0-beta.4 and 1.30.0-nightly (d5a448b3f 2018-08-13). I don't know if anyone would care to track down what fixed it, otherwise we can close.

@yodaldevoid
Copy link
Contributor

I had some time and decided to perform a git bisect. I looks like this was fixed with fe5710a, and considering the name of the commit, this makes sense. Heck, it even adds a test with a very similar input from issue #50585!

cuviper added a commit to cuviper/rust that referenced this issue Mar 4, 2019
This code no longer ICEs, and @yodaldevoid found that it was fixed by
commit fe5710a. While that added a similar test, we can explicitly test
this reproducer too.

Closes rust-lang#50582.
pietroalbini added a commit to pietroalbini/rust that referenced this issue Mar 8, 2019
Add an explicit test for issue rust-lang#50582

This code no longer ICEs, and @yodaldevoid found that it was fixed by
commit fe5710a. While that added a similar test, we can explicitly test
this reproducer too.

Closes rust-lang#50582.
bors added a commit that referenced this issue Mar 9, 2019
Rollup of 24 pull requests

Successful merges:

 - #58080 (Add FreeBSD armv6 and armv7 targets)
 - #58204 (On return type `impl Trait` for block with no expr point at last semi)
 - #58269 (Add librustc and libsyntax to rust-src distribution.)
 - #58369 (Make the Entry API of HashMap<K, V> Sync and Send)
 - #58861 (Expand where negative supertrait specific error is shown)
 - #58877 (Suggest removal of `&` when borrowing macro and appropriate)
 - #58883 (Suggest appropriate code for unused field when destructuring pattern)
 - #58891 (Remove stray ` in the docs for the FromIterator implementation for Option)
 - #58893 (race condition in thread local storage example)
 - #58906 (Monomorphize generator field types for debuginfo)
 - #58911 (Regression test for #58435.)
 - #58912 (Regression test for #58813)
 - #58916 (Fix release note problems noticed after merging.)
 - #58918 (Regression test added for an async ICE.)
 - #58921 (Add an explicit test for issue #50582)
 - #58926 (Make the lifetime parameters of tcx consistent.)
 - #58931 (Elide invalid method receiver error when it contains TyErr)
 - #58940 (Remove JSBackend from config.toml)
 - #58950 (Add self to mailmap)
 - #58961 (On incorrect cfg literal/identifier, point at the right span)
 - #58963 (libstd: implement Error::source for io::Error)
 - #58970 (delay_span_bug in wfcheck's ty.lift_to_tcx unwrap)
 - #58984 (Teach `-Z treat-err-as-bug` to take a number of errors to emit)
 - #59007 (Add a test for invalid const arguments)

Failed merges:

 - #58959 (Add release notes for PR #56243)

r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants