Skip to content

-Z hir-stats always panics? #43232

Closed
Closed
@zackmdavis

Description

@zackmdavis
$ cat scratch.rs 
fn main() {}
$ RUST_BACKTRACE=1 rustc scratch.rs -Z hir-stats

PRE EXPANSION AST STATS

Name                Accumulated Size         Count     Item Size
----------------------------------------------------------------
Mod                               40             1            40
FnDecl                            48             1            48
Block                             48             1            48
Item                             248             1           248
----------------------------------------------------------------
Total                            384


POST EXPANSION AST STATS

Name                Accumulated Size         Count     Item Size
----------------------------------------------------------------
Mod                               40             1            40
FnDecl                            48             1            48
Block                             48             1            48
PathSegment                      128             4            32
Attribute                        240             2           120
Item                             744             3           248
----------------------------------------------------------------
Total                          1_248

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.20.0-nightly (720c596ec 2017-07-08) running on x86_64-unknown-linux-gnu

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'visit_nested_xxx must be manually implemented in this visitor', /checkout/src/librustc_passes/hir_stats.rs:110:8
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:380
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:390
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:611
   5: std::panicking::begin_panic_new
   6: <rustc_passes::hir_stats::StatCollector<'v> as rustc::hir::intravisit::Visitor<'v>>::nested_visit_map
   7: <rustc_passes::hir_stats::StatCollector<'v> as rustc::hir::intravisit::Visitor<'v>>::visit_fn
   8: <rustc_passes::hir_stats::StatCollector<'v> as rustc::hir::intravisit::Visitor<'v>>::visit_item
   9: <rustc_passes::hir_stats::StatCollector<'v> as rustc::hir::intravisit::Visitor<'v>>::visit_mod
  10: rustc_passes::hir_stats::print_hir_stats
  11: rustc_driver::driver::phase_2_configure_and_expand
  12: rustc_driver::driver::compile_input
  13: rustc_driver::run_compiler

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions