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 with bound on struct and reference #16596

Closed
japaric opened this issue Aug 19, 2014 · 0 comments · Fixed by #18099
Closed

ICE with bound on struct and reference #16596

japaric opened this issue Aug 19, 2014 · 0 comments · Fixed by #18099
Labels
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 Aug 19, 2014

STR

trait MatrixRow {}

struct Mat;

impl<'a> MatrixRow for &'a Mat {}

// This `MatrixRow` bound is the ICE trigger
struct Rows<M: MatrixRow> {
    mat: M,
}

impl<'a> Iterator<()> for Rows<&'a Mat> {
    fn next(&mut self) -> Option<()> {
        unimplemented!()
    }
}

fn main() {}

Backtrace

ice.rs:12:1: 16:2 error: internal compiler error: cannot relate bound region: ReInfer(0) <= ReEarlyBound(25, TypeSpace, 0, 'a)
ice.rs:12 impl<'a> Iterator<()> for Rows<&'a Mat> {
ice.rs:13     fn next(&mut self) -> Option<()> {
ice.rs:14         unimplemented!()
ice.rs:15     }
ice.rs:16 }
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>', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/libsyntax/ast_util.rs:776

stack backtrace:
   1:     0x7f2d9ea02cf0 - rt::backtrace::imp::write::hd882173939e2d158lxr
   2:     0x7f2d9ea05dc0 - <unknown>
   3:     0x7f2da2f80a10 - unwind::begin_unwind_inner::h65c561bad0624ee8pie
   4:     0x7f2d9f9cb070 - <unknown>
   5:     0x7f2d9f9cafc0 - diagnostic::SpanHandler::span_bug::h5a0ec8db1633e4bejuF
   6:     0x7f2da37acc00 - driver::session::Session::span_bug::h7c5456bc0ef9253dBnB
   7:     0x7f2da3c8d3b0 - middle::typeck::infer::region_inference::RegionVarBindings<'a>::make_subregion::hde6481d2374d6a2d8v6
   8:     0x7f2da3c73580 - middle::typeck::infer::sub::Sub<'f>.Combine::regions::h410a00df0e5f98a9608
   9:     0x7f2da3c738f0 - middle::typeck::infer::sub::Sub<'f>.Combine::contraregions::h9bdb15d93411a604w08
  10:     0x7f2da3c5d2c0 - middle::typeck::infer::sub::Sub<'f>.Combine::tys::h0e415eeee3a782cdw98
  11:     0x7f2da3ccbb50 - <unknown>
  12:     0x7f2da3c5a910 - <unknown>
  13:     0x7f2da3ccb670 - <unknown>
  14:     0x7f2da3ccb630 - <unknown>
  15:     0x7f2da3c5a910 - <unknown>
  16:     0x7f2da3b55f20 - middle::typeck::infer::mk_eqty::hb30f4823806aa03aX2d
  17:     0x7f2da3b50a10 - <unknown>
  18:     0x7f2da3b4d8a0 - <unknown>
  19:     0x7f2da3b13230 - middle::ty::each_bound_trait_and_supertraits::he39981a7fbf91ecexlJ
  20:     0x7f2da3b4d320 - <unknown>
  21:     0x7f2da3b4b160 - <unknown>
  22:     0x7f2da38a82d0 - middle::typeck::check::vtable::check_param_bounds::hff22d8ef20003549TEN
  23:     0x7f2da38a7fe0 - <unknown>
  24:     0x7f2da3b0f3a0 - <unknown>
  25:     0x7f2da388dad0 - middle::ty::maybe_walk_ty::h22eb602ad62e119cFDF
  26:     0x7f2da389ec50 - <unknown>
  27:     0x7f2da38963e0 - <unknown>
  28:     0x7f2da3899eb0 - middle::kind::check_crate::hc3c3f3a11a49b3325mw
  29:     0x7f2da35ce7b0 - <unknown>
  30:     0x7f2da3e98370 - driver::driver::phase_3_run_analysis_passes::h60371fc635fbafd6lPz
  31:     0x7f2da3e934b0 - driver::driver::compile_input::h41b5be77a886d201rBz
  32:     0x7f2da3f409b0 - <unknown>
  33:     0x7f2da3f408c0 - <unknown>
  34:     0x7f2da3f532f0 - <unknown>
  35:     0x7f2da3f530f0 - <unknown>
  36:     0x7f2da32dcbc0 - <unknown>
  37:     0x7f2da2fd1930 - <unknown>
  38:     0x7f2da2fd1920 - rust_try
  39:     0x7f2da2f7e070 - unwind::try::hb59840f49a9c268eF6d
  40:     0x7f2da2f7de10 - task::Task::run::h16546e7aae493143Zcd
  41:     0x7f2da32dc980 - <unknown>
  42:     0x7f2da2f7fc50 - <unknown>
  43:     0x7f2d9dd7d000 - start_thread
  44:     0x7f2da2c4f269 - clone
  45:                0x0 - <unknown>

Version

rustc 0.12.0-pre (1721e8129 2014-08-18 10:11:03 +0000)

cc @pcwalton

@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 Oct 3, 2014
bors added a commit that referenced this issue Oct 18, 2014
Closes #9249.
Closes #13105.
Closes #13837.
Closes #13847.
Closes #15207.
Closes #15261.
Closes #16048. 
Closes #16098.
Closes #16256.
Closes #16562.
Closes #16596.
Closes #16709.
Closes #16747.
Closes #17025.
Closes #17121.
Closes #17450.
Closes #17636.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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