Skip to content

Type parameter <generic #0>/SelfSpace.0 (/SelfSpace/0) out of range #20072

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

Closed
jmcomets opened this issue Dec 20, 2014 · 5 comments
Closed

Type parameter <generic #0>/SelfSpace.0 (/SelfSpace/0) out of range #20072

jmcomets opened this issue Dec 20, 2014 · 5 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@jmcomets
Copy link
Contributor

I've just run on the following error (bug ?) :

Compiling castaway v0.0.1 (file:///home/jmcomets/Bundle/castaway)
/home/jmcomets/Bundle/castaway/src/main.rs:52:37: 52:40 error: internal compiler error: Type parameter `<generic #0>/SelfSpace.0` (<generic #0>/SelfSpace/0) out of range when substituting (root type=<generic #0>) substs=Substs[types=[[];[];[];[]], regions=[[];[];[];[]]]
/home/jmcomets/Bundle/castaway/src/main.rs:52     fn fitness(genome: Self) -> Box<Ord>;
                                                                                  ^~~
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:     0x7f893fa0dc60 - rt::backtrace::imp::write::hb0dcc4a5fc17fd0bFUx
   2:     0x7f893fa11030 - failure::on_fail::hcd3ce97bacbef1b03ly
   3:     0x7f893f651790 - unwind::begin_unwind_inner::h670ccdf2c60477f7aNc
   4:     0x7f893cd45010 - unwind::begin_unwind::h18115787115103468845
   5:     0x7f893cd44f90 - diagnostic::SpanHandler::span_bug::h39ed8e2c1c3326aeJBF
   6:     0x7f893db2dab0 - middle::subst::SubstFolder<'a, 'tcx>.TypeFolder<'tcx>::fold_ty::h65e2855c2c6e03c1InW
   7:     0x7f893edb9590 - astconv::create_substs_for_ast_path::h5481282849123362331
   8:     0x7f893edc4100 - astconv::ast_path_to_trait_ref::h6991508945067919296
   9:     0x7f893edbde90 - astconv::ast_ty_to_ty::unboxed_closure.37663
  10:     0x7f893edbd2f0 - astconv::ast_ty_to_ty::h2945428841397046121
  11:     0x7f893edc3cc0 - vec::Vec<T>.FromIterator<T>::from_iter::h13494501519480157583
  12:     0x7f893edc3ad0 - astconv::convert_angle_bracketed_parameters::h18384920995254134722
  13:     0x7f893edc1d20 - astconv::ast_path_to_ty::h15492367716461825224
  14:     0x7f893edbd2f0 - astconv::ast_ty_to_ty::h2945428841397046121
  15:     0x7f893edaaf50 - astconv::convert_ty_with_lifetime_elision::h10069183817061888302
  16:     0x7f893eda2ae0 - astconv::ty_of_method_or_bare_fn::h8762164913576701361
  17:     0x7f893ed6d620 - collect::collect_trait_methods::ty_method_of_trait_method::hcd62f270867cc8b2z5t
  18:     0x7f893ed286f0 - collect::convert::h2b10ccbb63916a231Ou
  19:     0x7f893eee9790 - check_crate::unboxed_closure.42652
  20:     0x7f893eee7a60 - check_crate::h0d4db076e0bb3313fZy
  21:     0x7f893fe618b0 - driver::phase_3_run_analysis_passes::h86f5117df0f02e2eEta
  22:     0x7f893fe44c50 - driver::compile_input::h024b52963d907b7crba
  23:     0x7f893fff8c90 - run_compiler::h028a909c6b8b5e8fAYb
  24:     0x7f893ffef8d0 - thunk::F.Invoke<A, R>::invoke::h18183104788496625744
  25:     0x7f893f9e6010 - thunk::F.Invoke<A, R>::invoke::h2541757334713289964
  26:     0x7f893f64ff00 - task::Task::spawn_thunk::closure.5783
  27:     0x7f893f6aea70 - rust_try_inner
  28:     0x7f893f6aea60 - rust_try
  29:     0x7f893f650010 - unwind::try::h558067038ea79d14rCc
  30:     0x7f893f64fda0 - task::Task::run::h0a756e41b4d98f97sNb
  31:     0x7f893f64f510 - thunk::F.Invoke<A, R>::invoke::h14009063998732615525
  32:     0x7f893f650e60 - thread::thread_start::h3654652a3d324e1eM4b
  33:     0x7f893a1aa0c0 - start_thread
  34:     0x7f893f314ec9 - __clone
  35:                0x0 - <unknown>

I can reproduce the error simply by compiling the following :

trait Foo {
    fn bar(baz: Self) -> Box<Ord>;
}

pub fn main() {
}
@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 20, 2014
@steveklabnik
Copy link
Member

Can you share any of your code?

@jmcomets
Copy link
Contributor Author

Yup, just edited the issue with the code.

I'm running the following version : rustc 0.13.0-nightly (42deaa5 2014-12-16 17:51:23 +0000)

@ghost
Copy link

ghost commented Dec 21, 2014

Thanks for the report! This would be a dupe of #18956 though I'll leave this open as the test case is slightly different (Box vs &).

@Munksgaard
Copy link
Contributor

With rustc 1.0.0-dev (4fc9b41 2015-01-13 05:01:34 +0000) the code example above returns the following:

$ rustc foo.rs
foo.rs:2:30: 2:33 error: explicit lifetime bound required
foo.rs:2     fn bar(baz: Self) -> Box<Ord>;
                                      ^~~

Perhaps we can close this issue?

Edit: The code from #18956 still exhibits the ICE.

@jmcomets
Copy link
Contributor Author

I agree, this also produces an error for me. Thanks for everything!

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