Skip to content

ICE when renaming self to alredy imported module on beta and nighly #56187

Closed
@Arvamer

Description

@Arvamer

Trying to compile:

use std::io::{self, prelude::{self as io}};

results in:

thread 'main' panicked at 'byte index 4294967293 is out of bounds of `self as io`', src/libcore/str/mod.rs:2094:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:211
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:480
   6: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:390
   7: rust_begin_unwind
             at src/libstd/panicking.rs:325
   8: core::panicking::panic_fmt
             at src/libcore/panicking.rs:77
   9: core::str::slice_error_fail
             at src/libcore/str/mod.rs:0
  10: core::str::traits::<impl core::slice::SliceIndex<str> for core::ops::range::RangeTo<usize>>::index::{{closure}}
  11: rustc_resolve::Resolver::report_conflict
  12: rustc_resolve::resolve_imports::ImportResolver::resolve_imports
  13: rustc_resolve::macros::<impl syntax::ext::base::Resolver for rustc_resolve::Resolver<'a, 'crateloader>>::resolve_imports
  14: syntax::ext::expand::MacroExpander::expand_fragment
  15: syntax::ext::expand::MacroExpander::expand_crate
  16: rustc_driver::driver::phase_2_configure_and_expand_inner::{{closure}}
  17: rustc::util::common::time
  18: rustc_driver::driver::phase_2_configure_and_expand
  19: rustc_driver::driver::compile_input
  20: rustc_driver::run_compiler_with_pool
  21: <scoped_tls::ScopedKey<T>>::set
  22: rustc_driver::run_compiler
  23: syntax::with_globals
  24: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:102
  25: rustc_driver::run
  26: rustc_driver::main
  27: std::rt::lang_start::{{closure}}
  28: std::panicking::try::do_call
             at src/libstd/rt.rs:59
             at src/libstd/panicking.rs:310
  29: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:102
  30: std::rt::lang_start_internal
             at src/libstd/panicking.rs:289
             at src/libstd/panic.rs:398
             at src/libstd/rt.rs:58
  31: main
  32: __libc_start_main
  33: <unknown>
query stack during panic:
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.32.0-nightly (00e03ee57 2018-11-22) running on x86_64-unknown-linux-gnu

same with

use std::io;
use std::collections::{self as io};

Metadata

Metadata

Assignees

Labels

A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyregression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions