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 using an associated type as the type parameter of a bound #19081

Closed
japaric opened this issue Nov 18, 2014 · 0 comments · Fixed by #19780
Closed

ICE: When using an associated type as the type parameter of a bound #19081

japaric opened this issue Nov 18, 2014 · 0 comments · Fixed by #19780
Labels
A-associated-items Area: Associated items such as associated types and consts. 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

@japaric
Copy link
Member

japaric commented Nov 18, 2014

Found this ICE while trying to convert the S in Hasher<S> into an associated type. (FWIW, I also hit #18611 in the process)

STR

#![feature(associated_types)]

pub trait Hasher{
    type State;

    fn hash<T: Hash< <Self as Hasher>::State>>(&self, value: &T) -> u64;
}

trait Hash<S> {
    fn hash(&self, state: &mut S);
}

Output

task 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/librustc/middle/subst.rs:388

stack backtrace:
   1:     0x7f702c7a9560 - rt::backtrace::imp::write::h2fa8e210cbdd14ecdUs
   2:     0x7f702c7ac5f0 - <unknown>
   3:     0x7f702cf5b320 - unwind::begin_unwind_inner::h2bf101b14ceccda8Pad
   4:     0x7f702cf5afa0 - unwind::begin_unwind_fmt::hc4fd72ddd00fb220h8c
   5:     0x7f702cf5af60 - rust_begin_unwind
   6:     0x7f702cf978b0 - panicking::panic_fmt::he52a5729773324b60Nl
   7:     0x7f702cf9cca0 - panicking::panic_bounds_check::h71560967a4c6e019yMl
   8:     0x7f702bb315a0 - middle::typeck::collect::is_associated_type_valid_for_param::h82471e75169a62c6R7D
   9:     0x7f702bb40370 - <unknown>
  10:     0x7f702bb23ea0 - <unknown>
  11:     0x7f702b910790 - <unknown>
  12:     0x7f702bb22670 - <unknown>
  13:     0x7f702bb221d0 - <unknown>
  14:     0x7f702bb220d0 - <unknown>
  15:     0x7f702bb21f20 - <unknown>
  16:     0x7f702bb1e750 - <unknown>
  17:     0x7f702baf86d0 - middle::typeck::collect::convert::hb88dec01b4ea2521NwE
  18:     0x7f702baf1f60 - middle::typeck::collect::collect_item_types::hcb8bf5c174f5a33bTvD
  19:     0x7f702bd08a50 - <unknown>
  20:     0x7f702bd07bc0 - middle::typeck::check_crate::ha3047a37f1357500XhJ
  21:     0x7f702d4420c0 - driver::driver::phase_3_run_analysis_passes::h4b7343c1d32e3d38RLR
  22:     0x7f702d436ee0 - driver::driver::compile_input::h5f97124b77daf0b6BsR
  23:     0x7f702d4b7a30 - <unknown>
  24:     0x7f702d4b7920 - <unknown>
  25:     0x7f702d2da520 - <unknown>
  26:     0x7f702d2da310 - <unknown>
  27:     0x7f702d7d9b90 - <unknown>
  28:     0x7f702cfaa680 - <unknown>
  29:     0x7f702cfaa670 - rust_try
  30:     0x7f702cf58c80 - unwind::try::h00b99ef8aa34ae99rZc
  31:     0x7f702cf58b10 - task::Task::run::h5f5b9665aeb0e846h5b
  32:     0x7f702d7d98d0 - <unknown>
  33:     0x7f702cf5a330 - <unknown>
  34:     0x7f7027b521d0 - start_thread
  35:     0x7f702cc311b9 - clone
  36:                0x0 - <unknown>

Version

rustc 0.13.0-dev (618bd5d1c 2014-11-18 15:26:43 +0000)

cc @nikomatsakis

@huonw huonw added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-associated-items Area: Associated items such as associated types and consts. labels Nov 20, 2014
@ghost ghost added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Dec 12, 2014
bors added a commit that referenced this issue Dec 18, 2014
Closes #5988.
Closes #10176.
Closes #10456.
Closes #12744.
Closes #13264.
Closes #13324.
Closes #14182.
Closes #15381.
Closes #15444.
Closes #15480.
Closes #15756.
Closes #16822.
Closes #16966.
Closes #17351.
Closes #17503.
Closes #17545.
Closes #17771.
Closes #17816.
Closes #17897.
Closes #17905.
Closes #18188.
Closes #18232.
Closes #18345.
Closes #18389.
Closes #18400.
Closes #18502.
Closes #18611.
Closes #18783.
Closes #19009.
Closes #19081.
Closes #19098.
Closes #19127.
Closes #19135.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items such as associated types and consts. 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

Successfully merging a pull request may close this issue.

2 participants