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

ICE: a type named ... has already been imported in this module. #26886

Closed
tbu- opened this issue Jul 8, 2015 · 5 comments
Closed

ICE: a type named ... has already been imported in this module. #26886

tbu- opened this issue Jul 8, 2015 · 5 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@tbu-
Copy link
Contributor

tbu- commented Jul 8, 2015

$ RUST_BACKTRACE=1 make
cfg: version 1.3.0-dev (fd8e175c4 2015-07-08)
cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples x86_64-unknown-linux-gnu
cfg: target triples x86_64-unknown-linux-gnu
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: good valgrind for x86_64-unknown-linux-gnu is 1
cfg: using CC=gcc (CFG_CC)
cfg: enabling valgrind run-pass tests (CFG_ENABLE_VALGRIND_RPASS)
cfg: valgrind-rpass command set to "/usr/bin/valgrind" --error-exitcode=100 --fair-sched=try --quiet --soname-synonyms=somalloc=NONE --suppressions=<path>/rust/src/etc/x86.supp  --tool=memcheck --leak-check=full
cfg: no pandoc found, omitting PDF and EPUB docs
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd
src/libstd/sys/unix/os.rs:24:5: 24:9 error: a type named `libc` has already been imported in this module [E0252]
src/libstd/sys/unix/os.rs:24 use libc;
                                 ^~~~
src/libstd/sys/unix/os.rs:24:5: 24:9 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=77573)', /home/rustbuild/src/rust-buildbot/slave/snap3-linux/build/src/libsyntax/ast_map/mod.rs:332

stack backtrace:
   1:     0x7f4ddcfa6889 - sys::backtrace::write::h8a79f17bd32af79cw6r
   2:     0x7f4ddcfaaf99 - panicking::on_panic::h006e51db1ed1fe0aHMw
   3:     0x7f4ddcf87e92 - rt::unwind::begin_unwind_inner::hc3f0d363d76c49d8Rrw
   4:     0x7f4ddcf88977 - rt::unwind::begin_unwind_fmt::hc35fd2b409178390Xqw
   5:     0x7f4ddcc9b164 - ast_map::Map<'ast>::expect_item::h5aa30640bac7278eFNw
   6:     0x7f4ddb75d00a - resolve_imports::ImportResolver<'a, 'b, 'tcx>::check_for_conflicting_import::h6ea3619a6cd9fe3bH4c
   7:     0x7f4ddb75c6ec - resolve_imports::ImportResolver<'a, 'b, 'tcx>::resolve_single_import::closure.15532
   8:     0x7f4ddb75922c - resolve_imports::ImportResolver<'a, 'b, 'tcx>::resolve_import_for_module::hadc6af6523c7b803ydc
   9:     0x7f4ddb755964 - resolve_imports::ImportResolver<'a, 'b, 'tcx>::resolve_imports_for_module_subtree::hd897beb4adc12cb3d6b
  10:     0x7f4ddb756122 - resolve_imports::ImportResolver<'a, 'b, 'tcx>::resolve_imports_for_module_subtree::hd897beb4adc12cb3d6b
  11:     0x7f4ddb756122 - resolve_imports::ImportResolver<'a, 'b, 'tcx>::resolve_imports_for_module_subtree::hd897beb4adc12cb3d6b
  12:     0x7f4ddb798efc - resolve_crate::h099d31118e996bc7Tai
  13:     0x7f4ddb4bae52 - driver::phase_3_run_analysis_passes::hb2cfd88f31771c50GGa
  14:     0x7f4ddb49fc8c - driver::compile_input::he676e67531d7acc5Qba
  15:     0x7f4ddb555e51 - run_compiler::h79d396569d40b0bao6b
  16:     0x7f4ddb5536a2 - boxed::F.FnBox<A>::call_box::h2275685322063474542
  17:     0x7f4ddb552e79 - rt::unwind::try::try_fn::h16543066540276063477
  18:     0x7f4ddcfb0378 - rust_try_inner
  19:     0x7f4ddcfb0365 - rust_try
  20:     0x7f4ddcf9e727 - rt::unwind::try::inner_try::hf64073dde2f58c9eKnw
  21:     0x7f4ddb5530aa - boxed::F.FnBox<A>::call_box::h222783876647075817
  22:     0x7f4ddcfa9dd1 - sys::thread::Thread::new::thread_start::ha4e6321e5d782d8c0xv
  23:     0x7f4ddaed6353 - start_thread
  24:     0x7f4dda2eebfc - __clone
  25:                0x0 - <unknown>

<path>/git/rust/mk/target.mk:171: recipe for target 'x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.std' failed
make: *** [x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.std] Error 101

Using the following diff:

$ git diff
diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs
index 334dd6b..b60faf6 100644
--- a/src/libstd/sys/unix/os.rs
+++ b/src/libstd/sys/unix/os.rs
@@ -21,6 +21,7 @@ use fmt;
 use io;
 use iter;
 use libc::{self, c_int, c_char, c_void};
+use libc;
 use mem;
 use ptr;
 use path::{self, PathBuf};
@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jul 9, 2015
@euclio
Copy link
Contributor

euclio commented Jul 26, 2015

Got this today. Can reproduce with something as simple as

use std::sync::{Arc};
use std::sync::Arc;

@arielb1 arielb1 added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 23, 2015
@arielb1
Copy link
Contributor

arielb1 commented Oct 23, 2015

does not affect 1.3+

@tbu-
Copy link
Contributor Author

tbu- commented Oct 23, 2015

Can confirm, no longer a problem. Should I close this issue?

@alexcrichton
Copy link
Member

It'd probably good to check in a test just to make sure, and now that this has E-needstest it'll just make its way into src/test at some point

@Manishearth
Copy link
Member

Opened #29273

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

6 participants