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 when pattern matching on &[T] #12567

Closed
tikue opened this issue Feb 26, 2014 · 1 comment
Closed

ICE when pattern matching on &[T] #12567

tikue opened this issue Feb 26, 2014 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@tikue
Copy link
Contributor

tikue commented Feb 26, 2014

merge.rs:

fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) {
    match (l1, l2) {
        ([], []) => println!("both empty"),
        ([], [hd, ..tl]) | ([hd, ..tl], []) => println!("one empty"),
        ([hd1, ..tl1], [hd2, ..tl2]) => println!("both nonempty"),
    }
}

fn main() {}
$ rustc merge.rs
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: the compiler hit an unexpected failure path. this is a bug
Ok(task 'rustc' failed at 'called `Option::unwrap()` on a `None` value', /Users/tkuehn/rust/src/libstd/option.rs:149
)

This is as minimal an example as I've been able to create that exhibits this ICE.

@mjhanninen
Copy link

I'm having this same problem. Here's backtrace:

rustc --out-dir build src/cat.rs
task 'rustc' failed at 'called `Option::unwrap()` on a `None` value', /private/tmp/rust-Q8uz/rust-0.10/src/libstd/option.rs:264
stack backtrace:
   1:        0x1084c68e4 - rt::backtrace::imp::write::h2a8a3b7117b6a3bag8b::v0.10
   2:        0x10842ab56 - rt::unwind::begin_unwind_inner::h13ee063055871ef1KIb::v0.10 
   3:        0x108429fc8 - rt::unwind::begin_unwind::hcf46aa8743077363kIb::v0.10
   4:        0x1084b1b11 - fmt::format_unsafe::hd5116fa5c4c9ce50cAS::v0.10
   5:        0x10845e4d1 - fmt::format::h8bf4d0c9e4e704d3UzS::v0.10
   6:        0x107ba5bc2 - diagnostic::print_diagnostic::hefa9ac952c0a6cb3u2b::v0.10
   7:        0x107ba3b1a - diagnostic::EmitterWriter.Emitter::emit::h06089cbc7baed50ax8b::v0.10
   8:        0x107ba18e4 - diagnostic::Handler::fatal::h345b5e2971fa50cbvSb::v0.10
   9:        0x105bd6118 - driver::session::Session::fatal::h8002452597140fadteh::v0.10
  10:        0x10624b573 - back::link::llvm_err::h6cd068d05a4f3b2ehl1::v0.10
  11:        0x10624b73f - back::link::WriteOutputFile::hd096c6e8f4b782f4dm1::v0.10
  12:        0x106250f3f - back::link::write::run_passes::closure.83784
  13:        0x105f3d13f - util::common::time::h9acad76c21817c9aXHh::v0.10
  14:        0x10624d1cd - back::link::write::run_passes::hbe6513f82bc31607so1::v0.10
  15:        0x106350aa1 - driver::driver::phase_5_run_llvm_passes::closure.90137
  16:        0x105f3d13f - util::common::time::h9acad76c21817c9aXHh::v0.10
  17:        0x10635093d - driver::driver::phase_5_run_llvm_passes::h22117e32ed7247datHf::v0.10
  18:        0x1063534b2 - driver::driver::compile_input::haa7c9f4729d6243csWf::v0.10
  19:        0x1063786c4 - run_compiler::hfd5ecc9785222053Yzn::v0.10
  20:        0x10638c36d - main_args::closure.92066
  21:        0x10638ab82 - monitor::closure.91951
  22:        0x10638672b - task::TaskBuilder::try::closure.91726
  23:        0x105b4649c - task::spawn_opts::closure.7957
  24:        0x1084c1d08 - rt::task::Task::run::closure.41637
  25:        0x1084cc5fc - rust_try
  26:        0x1084c1b87 - rt::task::Task::run::h544c274b867f177dNB9::v0.10
  27:        0x105b4631f - task::spawn_opts::closure.7929
  28:        0x1084c52c6 - rt::thread::thread_start::hc06c53d926f6e6a3uga::v0.10
  29:     0x7fff8edac899 - _pthread_body
  30:     0x7fff8edac72a - _pthread_struct_init

and output from rustc -v:

rustc 0.10
host: x86_64-apple-darwin

@huonw huonw added the I-ICE label Apr 4, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue May 3, 2024
…1995

Fix `FormatArgs` storage when `-Zthreads` > 1

Fixes rust-lang#11886

The initial way I thought of was a little gross so I never opened a PR for it, I thought of a nicer way today that no longer involves any `thread_local`s or `static`s

`rustc_data_strucutres::sync::{Lrc, OnceLock}` implement `DynSend` + `DynSync` so we can pass them to the lint passes that need the storage

changelog: none

r? `@flip1995`
flip1995 pushed a commit to flip1995/rust that referenced this issue May 3, 2024
…1995

Fix `FormatArgs` storage when `-Zthreads` > 1

Fixes rust-lang#11886

The initial way I thought of was a little gross so I never opened a PR for it, I thought of a nicer way today that no longer involves any `thread_local`s or `static`s

`rustc_data_strucutres::sync::{Lrc, OnceLock}` implement `DynSend` + `DynSync` so we can pass them to the lint passes that need the storage

changelog: none

r? `@flip1995`
xFrednet pushed a commit to xFrednet/rust that referenced this issue May 5, 2024
…1995

Fix `FormatArgs` storage when `-Zthreads` > 1

Fixes rust-lang#11886

The initial way I thought of was a little gross so I never opened a PR for it, I thought of a nicer way today that no longer involves any `thread_local`s or `static`s

`rustc_data_strucutres::sync::{Lrc, OnceLock}` implement `DynSend` + `DynSync` so we can pass them to the lint passes that need the storage

changelog: none

r? `@flip1995`
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

No branches or pull requests

3 participants