Skip to content

ICE: cannot relate bound region #17174

Closed
Closed

Description

Os is Ubuntu 14.04.1 LTS

uname -a is Linux ubuntu 3.13.0-34-generic #60-Ubuntu SMP Wed Aug 13 15:45:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

rustc -v is rustc 0.12.0-pre-nightly (e024017f6 2014-09-04 20:21:02 +0000)

Code:

use std::io;

pub struct Sector<'sector, T: 'sector + io::Reader> {
    buffer: &'sector mut T
}

impl<'sector, T: 'sector + io::Reader> io::Reader for Sector<'sector, T> {
    fn read(&mut self, buf: &mut [u8]) -> io::IoResult<uint> {
        Ok(1)
    }
}

pub struct TIFF<T: io::Reader> {
    buffer: T
}

pub struct EXIF<'exif, T: 'exif + io::Reader> {
    buffer: T,
    tiff: Option<TIFF<Sector<'exif, T>>>
}

fn main() {
    return;
}

Error with backtrace:

test.rs:18:1: 21:2 error: internal compiler error: cannot relate bound region: ReEarlyBound(71, TypeSpace, 0, 'exif) <= ReInfer(0)
test.rs:18 pub struct EXIF<'exif, T: 'exif + io::Reader> {
test.rs:19     buffer: T,
test.rs:20     tiff: Option<TIFF<Sector<'exif, T>>>
test.rs:21 }
note: the compiler hit an unexpected failure path. 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' failed at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/ast_util.rs:776

stack backtrace:
   1:     0x7fe9ff248e80 - rt::backtrace::imp::write::h4d7dee61fe5a8b45bLq
   2:     0x7fe9ff24c020 - failure::on_fail::hc85ceca22206a645T6q
   3:     0x7fea03843810 - unwind::begin_unwind_inner::h9f77a03cfeff340062d
   4:     0x7fea0066b580 - unwind::begin_unwind::h16277544611788509136
   5:     0x7fea0066b4d0 - diagnostic::SpanHandler::span_bug::hc5ee97e818833447DaF
   6:     0x7fea0404e210 - driver::session::Session::span_bug::h86708ae800cea0fdv3C
   7:     0x7fea04557cd0 - middle::typeck::infer::region_inference::RegionVarBindings<'a>::make_subregion::hba58d918df004613xib
   8:     0x7fea045122d0 - middle::typeck::infer::region_inference::RegionVarBindings<'a>::make_eqregion::h4414b1b6402cb71bWhb
   9:     0x7fea04511f40 - middle::typeck::infer::equate::Equate<'f>.Combine::regions::he7a6f2cd80b332508R6
  10:     0x7fea04515490 - middle::typeck::infer::combine::Combine::substs::h1799504273808601407
  11:     0x7fea0450e600 - middle::typeck::infer::equate::Equate<'f>.Combine::tys::hb845466f77f1eebai06
  12:     0x7fea045737d0 - middle::typeck::infer::mk_eqty::closure.133562
  13:     0x7fea04572490 - middle::typeck::infer::InferCtxt<'a>::commit_if_ok::closure.133498
  14:     0x7fea04858730 - middle::typeck::infer::InferCtxt<'a>::commit_if_ok::closure.133560
  15:     0x7fea045086f0 - middle::typeck::infer::InferCtxt<'a>::try::h18049815333742934132
  16:     0x7fea043fb770 - middle::typeck::infer::mk_eqty::hfc0777bb72d04e5fHwg
  17:     0x7fea043f6ac0 - middle::typeck::check::vtable::search_for_vtable::h88c767a301014852vSM
  18:     0x7fea043f4030 - middle::typeck::check::vtable::lookup_vtables_for_param::closure.128619
  19:     0x7fea043c0a90 - middle::ty::each_bound_trait_and_supertraits::h89adfcc1aac3d011jsJ
  20:     0x7fea043f3990 - middle::typeck::check::vtable::lookup_vtables_for_param::ha697a2b5f0dd0757JmM
  21:     0x7fea043f1300 - middle::typeck::check::vtable::lookup_vtables::h0b1d6eb0c2c133a6MgM
  22:     0x7fea0413e2b0 - middle::typeck::check::vtable::check_param_bounds::h0948ed90bbf810d59YN
  23:     0x7fea0413dfa0 - middle::kind::check_bounds_on_structs_or_enums_in_type_if_possible::closure.114337
  24:     0x7fea043bce50 - middle::ty::walk_ty::closure.127445
  25:     0x7fea04856410 - middle::ty::maybe_walk_ty::closure.127447
  26:     0x7fea04124d30 - middle::ty::maybe_walk_ty::hc9403ac68a6ceee5OEF
  27:     0x7fea04124d30 - middle::ty::maybe_walk_ty::hc9403ac68a6ceee5OEF
  28:     0x7fea04135be0 - middle::kind::check_bounds_on_structs_or_enums_in_type_if_possible::hfdcb82f362415059dex
  29:     0x7fea0412d9c0 - middle::kind::check_item::hbb770539f77f0403NEw
  30:     0x7fea04131580 - middle::kind::check_crate::ha4c379c5048a93d2msw
  31:     0x7fea03e961c0 - util::common::time::h8294075438629166868
  32:     0x7fea0473c810 - driver::driver::phase_3_run_analysis_passes::h4a780b03b559207fLkC
  33:     0x7fea04738380 - driver::driver::compile_input::hd5726d979287d37dy6B
  34:     0x7fea047cba10 - driver::run_compiler::hf71713faf6367526YVF
  35:     0x7fea047cb9c0 - driver::main_args::closure.144622
  36:     0x7fea047de370 - task::TaskBuilder<S>::try_future::closure.145791
  37:     0x7fea047de170 - task::TaskBuilder<S>::spawn_internal::closure.145768
  38:     0x7fea03b9b4c0 - task::spawn_opts::closure.8379
  39:     0x7fea03899320 - rust_try_inner
  40:     0x7fea03899310 - rust_try
  41:     0x7fea03840f60 - unwind::try::hd71c364f2ee27fc1gRd
  42:     0x7fea03840dc0 - task::Task::run::h7964802050e4385692c
  43:     0x7fea03b9b220 - task::spawn_opts::closure.8325
  44:     0x7fea038428d0 - thread::thread_start::hdb150e157ee517fagod
  45:     0x7fe9fe5e50c0 - start_thread
  46:     0x7fea0350c359 - __clone
  47:                0x0 - <unknown>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsI-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