Skip to content

Compiler panic on nightly when using self in main.rs in nightly 1.25 #47623

Closed
@IntrepidPig

Description

@IntrepidPig

When I add a use self statement to my main.rs file, the compiler panics.
This code:

use self;
fn main() {}

The compiler properly prints the error about using self in a use statement that doesn't use {}, but it also panics with this message:

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:335:21
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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:68
             at libstd/sys_common/backtrace.rs:57
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:390
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
             at libstd/panicking.rs:537
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:521
   7: rust_begin_unwind
             at libstd/panicking.rs:497
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   9: core::panicking::panic
             at libcore/panicking.rs:51
  10: rustc::hir::lowering::LoweringContext::lower_use_tree
  11: rustc::hir::lowering::LoweringContext::lower_item
  12: <rustc::hir::lowering::LoweringContext::lower_crate::ItemLowerer<'lcx, 'interner> as syntax::visit::Visitor<'lcx>>::visit_item
  13: rustc::hir::lowering::lower_crate
  14: rustc::util::common::time
  15: rustc_driver::driver::compile_input
  16: rustc_driver::run_compiler

Version:

rustc 1.25.0-nightly (5965b7901 2018-01-19)
binary: rustc
commit-hash: 5965b790142eff7a8546e947914e7a8e00c61575
commit-date: 2018-01-19
host: x86_64-unknown-linux-gnu
release: 1.25.0-nightly
LLVM version: 4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions