Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ICE: nested mods, improper namespace usage, match on struct named Buffer #18986

Closed
mathall opened this issue Nov 15, 2014 · 0 comments · Fixed by #19013
Closed

ICE: nested mods, improper namespace usage, match on struct named Buffer #18986

mathall opened this issue Nov 15, 2014 · 0 comments · Fixed by #19013

Comments

@mathall
Copy link

mathall commented Nov 15, 2014

Not the best title, but I suppose it somehow summarizes the situation.
There's no ICE if I un-comment "use buffer" and prefix Buffer as the comment is suggesting. There's also no ICE if I rename Buffer into anything else. (fun!)

mod stuff {
  pub struct Buffer {
    pub x: int,
  }
}

mod user {
  use stuff;

  fn make_buffer() -> stuff::Buffer {
    stuff::Buffer{x: 0}
  }

  mod oops {
    //use stuff;
    fn test() {
      match super::make_buffer() {
        Buffer{x: 0} => panic!(),  // stuff::Buffer
        _            => panic!(),
      };
    }
  }
}

fn main() {
}

ERROR:rbml::::reader: failed to find block with tag 7
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with RUST_BACKTRACE=1 for a backtrace

task 'rustc' panicked at 'explicit panic', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/librbml/lib.rs:247

stack backtrace:
1: 0x10e4cb01f - rt::backtrace::imp::write::h37f6e30fade15cb76mt
2: 0x10e4ce1a7 - failure::on_fail::h4075de659ea4adb9VDt
3: 0x10e750415 - unwind::begin_unwind_inner::h9e12d6856ac2af42j1c
4: 0x10ca9052b - unwind::begin_unwind::h11182489159142915490
5: 0x10ca8f5e3 - reader::get_doc::hc5118bbb2b31c59eaRa
6: 0x10b3e0caf - middle::ty::lookup_item_type::h7caf3571e12f2099GPK
7: 0x10b6157a7 - middle::typeck::check::_match::check_pat_struct::h530d0497877c87a3hpN
8: 0x10b611f50 - middle::typeck::check::_match::check_pat::h711bfcd44ca5f0e512M
9: 0x10b616adc - middle::typeck::check::_match::check_match::h47cf5b76682ede75dmN
10: 0x10b6b71a7 - middle::typeck::check::check_expr_with_unifier::h5cc319219e4634c5KDZ
11: 0x10b70c8c8 - middle::typeck::check::check_stmt::h009ea09e991284aaHK1
12: 0x10b67c4df - middle::typeck::check::check_block_with_expected::h5b0b62d59a49dca7QO1
13: 0x10b67974f - middle::typeck::check::check_fn::h34037919bf4d6fc6agW
14: 0x10b678c7f - middle::typeck::check::check_bare_fn::h84006153c3903b4bp5V
15: 0x10b674dfd - middle::typeck::check::check_item::hbe92f8f4fa881f38ypW
16: 0x10b678652 - visit::walk_mod::h13658454776526124109
17: 0x10b67865d - visit::walk_mod::h13658454776526124109
18: 0x10b678adb - middle::typeck::check::check_item_types::h33c841ee77106c9fz4V
19: 0x10b18a3e6 - util::common::time::h7952646948545449844
20: 0x10b9837fe - middle::typeck::check_crate::h56303c294c543c95rrp
21: 0x10b9ea561 - driver::driver::phase_3_run_analysis_passes::hd9e3e0ce5c907bdctaC
22: 0x10b9e53b8 - driver::driver::compile_input::h73a7648d6863cf25eRB
23: 0x10ba6289d - driver::run_compiler::ha880c9a92de1aa35vHF
24: 0x10ba60dde - driver::run::closure.146204
25: 0x10b1a269b - task::TaskBuilder::try_future::closure.104764
26: 0x10b1a2593 - task::TaskBuilder::spawn_internal::closure.104735
27: 0x10b1607bd - task::NativeSpawner.Spawner::spawn::closure.2551
28: 0x10e7aea0c - rust_try_inner
29: 0x10e7ae9f6 - rust_try
30: 0x10e74dbe7 - unwind::try::h009a35089a5882701Pc
31: 0x10e74da7c - task::Task::run::h4878cb7b665069bf61b
32: 0x10b1605e3 - task::NativeSpawner.Spawner::spawn::closure.2475
33: 0x10e74f2a7 - thread::thread_start::h8e83ad43ae75daab3mc
34: 0x7fff8bef02fc - _pthread_body
35: 0x7fff8bef0279 - _pthread_body

rustc 0.13.0-nightly (e82f60e 2014-11-11 22:37:05 +0000)
binary: rustc
commit-hash: e82f60e
commit-date: 2014-11-11 22:37:05 +0000
host: x86_64-apple-darwin
release: 0.13.0-nightly

@ghost ghost self-assigned this Nov 15, 2014
lnicola pushed a commit to lnicola/rust that referenced this issue Jan 27, 2025
Goto `Display::fmt` when invoked on `to_string`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant