Skip to content

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

Closed
@jmcomets

Description

@jmcomets

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() {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions