Skip to content

ICE - importing a module twice, once via glob #25763

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

Closed
shepmaster opened this issue May 24, 2015 · 0 comments · Fixed by #25791
Closed

ICE - importing a module twice, once via glob #25763

shepmaster opened this issue May 24, 2015 · 0 comments · Fixed by #25791
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@shepmaster
Copy link
Member

This only appears to occur in nightly (1.2.0-dev). The playpen has no issues for stable or beta.

Reproduction

use std::{fmt,io};
use std::fmt;

fn main() {}

Output

ice.rs:2:5: 2:13 error: a type named `fmt` has already been imported in this module [E0252]
ice.rs:2 use std::fmt;
             ^~~~~~~~
ice.rs:2:5: 2:13 help: run `rustc --explain E0252` to see a detailed explanation
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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'expected item, found unknown node (id=5)', /Users/shep/Projects/rust/src/libsyntax/ast_map/mod.rs:332

stack backtrace:
   1:        0x10589c26f - sys::backtrace::write::h2bca3a61c3b55d9872r
   2:        0x1058a4dd0 - panicking::on_panic::h3e9ef2bf8e418f81Ijw
   3:        0x10585fba5 - rt::unwind::begin_unwind_inner::he821e5a533856e07r1v
   4:        0x1058609ac - rt::unwind::begin_unwind_fmt::hed0215f4ac0fdeeax0v
   5:        0x104f96452 - ast_map::Map<'ast>::expect_item::h0e10eee0bfdfe3caiGw
   6:        0x10284d673 - resolve_imports::ImportResolver<'a, 'b, 'tcx>::check_for_conflicting_import::hfebb0cf79e3285c8G4c
   7:        0x10284cce2 - resolve_imports::ImportResolver<'a, 'b, 'tcx>::resolve_single_import::closure.15495
   8:        0x1028493e8 - resolve_imports::ImportResolver<'a, 'b, 'tcx>::resolve_import_for_module::h812ee6d1353ff329xdc
   9:        0x102845a27 - resolve_imports::ImportResolver<'a, 'b, 'tcx>::resolve_imports_for_module_subtree::hf772a7c4e28562c9c6b
  10:        0x10288d654 - resolve_crate::h73409eb0503c32dfQai
  11:        0x10231573b - driver::phase_3_run_analysis_passes::h3588a3054907dc71tGa
  12:        0x1022fbb93 - driver::compile_input::h2d12543cc8aeb021Qba
  13:        0x1023b7073 - run_compiler::h933db40d755b0670b6b
  14:        0x1023b47da - boxed::F.FnBox<A>::call_box::h5310392069810752828
  15:        0x1023b3ed7 - rt::unwind::try::try_fn::h18400641036802977081
  16:        0x10592fcc8 - rust_try_inner
  17:        0x10592fcb5 - rust_try
  18:        0x10588ef65 - rt::unwind::try::inner_try::h546a6a033a0ae675kXv
  19:        0x1023b4155 - boxed::F.FnBox<A>::call_box::h1752658228916803127
  20:        0x1058a38dd - sys::thread::Thread::new::thread_start::hc24337cebd0dd75aXlv
  21:     0x7fff93567267 - _pthread_body
  22:     0x7fff935671e4 - _pthread_start

Meta

rustc 1.2.0-dev (c3d60aba6 2015-05-21) (built 2015-05-21)
binary: rustc
commit-hash: c3d60aba6c86883c79055c1a3923d4db116b644e
commit-date: 2015-05-21
build-date: 2015-05-21
host: x86_64-apple-darwin
release: 1.2.0-dev
@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label May 25, 2015
barosl added a commit to barosl/rust that referenced this issue May 26, 2015
Currently, for `use` declarations with multiple paths, only the `use`
item itself is saved in the AST map, not the individual path nodes. This
can lead to a problem when a span of a specific path node is needed.

For example, rust-lang#24818 caused an ICE because of this, in
`ImportResolver::check_for_conflicting_import()`.

Fixes rust-lang#25763.
barosl added a commit to barosl/rust that referenced this issue May 26, 2015
Currently, for `use` declarations with multiple paths, only the `use`
item itself is saved in the AST map, not the individual path nodes. This
can lead to a problem when a span of a specific path node is needed.

For example, rust-lang#24818 caused an ICE because of this, in
`ImportResolver::check_for_conflicting_import()`.

Fixes rust-lang#25763.
bors added a commit that referenced this issue May 27, 2015
Currently, for `use` declarations with multiple paths, only the `use` item itself is saved in the AST map, not the individual path nodes. This can lead to a problem when a span of a specific path node is needed.

For example, #24818 caused an ICE because of this, in `ImportResolver::check_for_conflicting_import()`.

Fixes #25763.
XMPPwocky pushed a commit to XMPPwocky/rust that referenced this issue May 29, 2015
Currently, for `use` declarations with multiple paths, only the `use`
item itself is saved in the AST map, not the individual path nodes. This
can lead to a problem when a span of a specific path node is needed.

For example, rust-lang#24818 caused an ICE because of this, in
`ImportResolver::check_for_conflicting_import()`.

Fixes rust-lang#25763.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants