Closed
Description
Input:
fn f() {
|x: [u8; break]| loop { };
}
fn main() {
macro_rules! vec {
(*) => ()
}
}
Output:
$ rustc -Z external-macro-backtrace -
...
thread 'main' panicked at 'assertion failed: self.tcx.sess.err_count() > 0', librustc_typeck/check/mod.rs:3783:19
...
6: std::panicking::begin_panic
at /home/vegard/rust/src/libstd/panicking.rs:397
7: rustc_typeck::check::FnCtxt::check_expr_kind
at librustc_typeck/check/mod.rs:3783
8: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
at librustc_typeck/check/mod.rs:3530
9: rustc_typeck::check::typeck_tables_of::{{closure}}
at librustc_typeck/check/mod.rs:2864
at librustc_typeck/check/mod.rs:2858
at librustc_typeck/check/mod.rs:2851
at librustc_typeck/check/mod.rs:885
...
Complete output
$ rustc -Z external-macro-backtrace -
warning: unused macro definition
--> <anon>:6:5
|
6 | / macro_rules! vec {
7 | | (*) => ()
8 | | }
| |_____^
|
= note: #[warn(unused_macros)] on by default
thread 'main' panicked at 'assertion failed: self.tcx.sess.err_count() > 0', librustc_typeck/check/mod.rs:3783:19
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_typeck::check::FnCtxt::check_expr_kind
at librustc_typeck/check/mod.rs:3783
8: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
at librustc_typeck/check/mod.rs:3530
9: rustc_typeck::check::typeck_tables_of::{{closure}}
at librustc_typeck/check/mod.rs:2864
at librustc_typeck/check/mod.rs:2858
at librustc_typeck/check/mod.rs:2851
at librustc_typeck/check/mod.rs:885
10: 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
11: rustc::dep_graph::graph::DepGraph::with_task_impl
at librustc/ty/maps/plumbing.rs:723
at librustc/dep_graph/graph.rs:343
12: 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
13: 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
14: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_tables_of
at librustc/ty/maps/plumbing.rs:776
at librustc/ty/maps/plumbing.rs:769
15: rustc_mir::interpret::const_eval::const_eval_provider
at librustc_mir/interpret/const_eval.rs:447
16: rustc::dep_graph::graph::DepGraph::with_task_impl
at librustc/ty/maps/plumbing.rs:723
at librustc/dep_graph/graph.rs:343
17: 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
18: 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
19: <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
20: <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
21: 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
22: <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
23: <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::ast_ty_to_ty
at librustc_typeck/astconv.rs:1095
24: rustc_typeck::check::closure::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::supplied_sig_of_closure
at librustc_typeck/check/closure.rs:604
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/libcore/iter/mod.rs:814
at /home/vegard/rust/src/librustc_data_structures/array_vec.rs:197
at /home/vegard/rust/src/librustc_data_structures/accumulate_vec.rs:113
at /home/vegard/rust/src/libcore/iter/iterator.rs:1375
at /home/vegard/rust/src/librustc/ty/context.rs:2729
at /home/vegard/rust/src/librustc/ty/context.rs:2717
at /home/vegard/rust/src/librustc/ty/context.rs:2569
at librustc_typeck/check/closure.rs:610
25: rustc_typeck::check::closure::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::sig_of_closure_no_expectation
at librustc_typeck/check/closure.rs:379
26: rustc_typeck::check::closure::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::check_closure
at librustc_typeck/check/closure.rs:365
at librustc_typeck/check/closure.rs:88
27: rustc_typeck::check::FnCtxt::check_expr_kind
at librustc_typeck/check/closure.rs:66
at librustc_typeck/check/mod.rs:3910
28: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
at librustc_typeck/check/mod.rs:3530
29: 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
30: rustc_typeck::check::FnCtxt::check_block_with_expected
at librustc_typeck/check/mod.rs:5070
at librustc_typeck/check/mod.rs:4359
31: rustc_typeck::check::FnCtxt::check_expr_kind
at librustc_typeck/check/mod.rs:3913
32: rustc_typeck::check::FnCtxt::check_expr_with_expectation_and_needs
at librustc_typeck/check/mod.rs:3530
33: 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
34: rustc_typeck::check::check_fn
at librustc_typeck/check/mod.rs:1081
35: rustc_typeck::check::typeck_tables_of::{{closure}}
at librustc_typeck/check/mod.rs:871
36: 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
37: rustc::dep_graph::graph::DepGraph::with_task_impl
at librustc/ty/maps/plumbing.rs:723
at librustc/dep_graph/graph.rs:343
38: 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
39: 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
40: 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
41: 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
42: rustc::dep_graph::graph::DepGraph::with_task_impl
at librustc/ty/maps/plumbing.rs:723
at librustc/dep_graph/graph.rs:343
43: 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
44: 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
45: 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
46: 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
47: rustc_driver::driver::compile_input
at librustc_driver/driver.rs:1095
at librustc_driver/driver.rs:231
48: rustc_driver::run_compiler
at librustc_driver/lib.rs:540
at librustc_driver/lib.rs:457
at /home/vegard/.cargo/registry/src/github.com-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/github.com-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
49: rustc_driver::monitor::{{closure}}
at librustc_driver/lib.rs:1684
at librustc_driver/lib.rs:174
at librustc_driver/lib.rs:1598
50: __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:105
51: 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
52: rustc_driver::main
at librustc_driver/lib.rs:1677
53: std::rt::lang_start::{{closure}}
at /home/vegard/rust/src/libstd/rt.rs:74
54: std::panicking::try::do_call
at libstd/rt.rs:59
at libstd/panicking.rs:310
55: __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:105
56: std::rt::lang_start_internal
at libstd/panicking.rs:289
at libstd/panic.rs:374
at libstd/rt.rs:58
57: main
58: __libc_start_main
59: _start
query stack during panic:
#0 [typeck_tables_of] processing `f::{{closure}}::{{initializer}}`
#1 [const_eval] const-evaluating `f::{{closure}}::{{initializer}}`
#2 [typeck_tables_of] processing `f`
#3 [typeck_item_bodies] type-checking all item bodies
end of query stack
error: internal compiler error: unexpected panic
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
On commit c166b03.