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: Type parameter _/FnSpace.1 (_/FnSpace/1) out of range when substituting (root type=_) #20005

Closed
japaric opened this issue Dec 19, 2014 · 0 comments · Fixed by #20404
Closed

Comments

@japaric
Copy link
Member

japaric commented Dec 19, 2014

STR

#![crate_type = "lib"]
#![feature(associated_types)]

trait From<Src> {
    type Result;

    fn from(src: Src) -> Self::Result;
}

trait To {
    fn to<Dst: From<Self>>(self) -> Dst::Result {
        From::from(self)
    }
}

Output

ice.rs:1:1: 1:1 error: internal compiler error: Type parameter `Result/FnSpace.1` (Result/FnSpace/1) out of range when substituting (root type=Result) substs=Substs[types=[[];[Self];[];[Dst]], regions=[[];[];[];[]]]
ice.rs:1 #![crate_type = "lib"]
         ^
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 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/diagnostic.rs:129

stack backtrace:
   1:     0x7f20a6029f30 - rt::backtrace::imp::write::h6412f7a49a1f3feaxXx
   2:     0x7f20a602d300 - failure::on_fail::hddee9b01525d1cc0Uoy
   3:     0x7f20a5c6d6b0 - unwind::begin_unwind_inner::hedcb21b2885493daaNc
   4:     0x7f20a3348270 - unwind::begin_unwind::h8700464743899426751
   5:     0x7f20a33481f0 - diagnostic::SpanHandler::span_bug::hc71fab85126cb6e2HBF
   6:     0x7f20a413cac0 - middle::subst::SubstFolder<$u{27}a$C$$u{20}$u{27}tcx$GT$.TypeFolder$LT$$u{27}tcx$GT$::fold_ty::hd27de014609b6ac5QfX
   7:     0x7f20a428b470 - vec::Vec<T>.FromIterator<T>::from_iter::h1323722657915396377
   8:     0x7f20a428b310 - middle::subst::VecPerParamSpace<T>::map_enumerated::h18018577534444447539
   9:     0x7f20a428ace0 - middle::ty_fold::super_fold_substs::h17168085672544058693
  10:     0x7f20a42b34d0 - middle::ty::Generics<$u{27}tcx$GT$::to_bounds::h8c2e7348f302947fOc9
  11:     0x7f20a42c5700 - middle::ty::construct_parameter_environment::h3b663cbb00f0518cGwe
  12:     0x7f20a40e7c80 - middle::ty::ParameterEnvironment<$u{27}tcx$GT$::for_item::h5aac0d5e762c820fNw9
  13:     0x7f20a52cce60 - check::check_method_body::hf79a9ae86800a9d5cHk
  14:     0x7f20a52c1020 - check::check_item::h2fd7cea4c7d59b025wk
  15:     0x7f20a5525620 - check_crate::unboxed_closure.42755
  16:     0x7f20a5520330 - check_crate::h9dd101b38ed58fa5W3y
  17:     0x7f20a64817a0 - driver::phase_3_run_analysis_passes::h77e8562ce41cfd75Eta
  18:     0x7f20a6464b10 - driver::compile_input::h81ce80bbe914c387rba
  19:     0x7f20a6618b50 - run_compiler::h2d4853ffa824f88bAYb
  20:     0x7f20a660f790 - thunk::F.Invoke<A,$u{20}R$GT$::invoke::h7351313412113629600
  21:     0x7f20a60022e0 - thunk::F.Invoke<A,$u{20}R$GT$::invoke::h4423555442319517089
  22:     0x7f20a5c6be20 - task::Task::spawn_thunk::closure.5804
  23:     0x7f20a5cca9c0 - rust_try_inner
  24:     0x7f20a5cca9b0 - rust_try
  25:     0x7f20a5c6bf30 - unwind::try::h870bc6c90527a031rCc
  26:     0x7f20a5c6bcc0 - task::Task::run::h3063eac886af1b39tNb
  27:     0x7f20a5c6b430 - thunk::F.Invoke<A,$u{20}R$GT$::invoke::h3611139983400510208
  28:     0x7f20a5c6cd80 - thread::thread_start::h6cf2d96de299983bM4b
  29:     0x7f20a07aa250 - start_thread
  30:     0x7f20a5940589 - clone
  31:                0x0 - <unknown>

Version

rustc 0.13.0-nightly (2a231594c 2014-12-18 12:21:57 +0000)

cc @nick29581 @nikomatsakis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant