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: the type of this value must be known in this context #24363

Closed
mason-larobina opened this issue Apr 13, 2015 · 3 comments · Fixed by #24475
Closed

ICE: the type of this value must be known in this context #24363

mason-larobina opened this issue Apr 13, 2015 · 3 comments · Fixed by #24475
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@mason-larobina
Copy link

While fiddling with some code I stumbled upon an internal compiler error with the following:
https://gist.github.com/mason-larobina/9e7dd78e4b605329800c

Here is the backtrace:

~/src/rust-sudoku$ RUST_BACKTRACE=1 cargo test                                                                                                                                                       
   Compiling rust-sudoku v0.0.1 (file:///usr/local/google/home/masonl/src/rust-sudoku)
src/main.rs:28:9: 28:11 error: mismatched types:
 expected `Point`,
    found `&_`
(expected struct `Point`,
    found &-ptr) [E0308]
src/main.rs:28     let &p = update.point;
                       ^~
src/main.rs:29:16: 29:19 error: the type of this value must be known in this context
src/main.rs:29     self.cells[p.y][p.x] = update.value;
                              ^~~
error: internal compiler error: no type for expr in fcx 0x7f481bbecfb0
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:190

stack backtrace:
   1:     0x7f48239e23c8 - sys::backtrace::write::h179e141147f9ee14IJC
   2:     0x7f4823a0d770 - panicking::on_panic::h6aa569d33389f0cfsXI
   3:     0x7f48239454a3 - rt::unwind::begin_unwind_inner::h082f07869f4b9731ACI
   4:     0x7f4820ce904d - rt::unwind::begin_unwind::h13428428822164950735
   5:     0x7f4820ce97a2 - diagnostic::Handler::bug::h7dec5f2940917255ZsB
   6:     0x7f48216fc82b - session::Session::bug::hc743ab3e9fbf0b0bnYq
   7:     0x7f482260a9e7 - check::FnCtxt<'a, 'tcx>::expr_ty::hbdbb2c3d06403ae1qwp
   8:     0x7f4822627e77 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::hadfaa727ac46dd801bc
   9:     0x7f4822628227 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::hadfaa727ac46dd801bc
  10:     0x7f4822628813 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::hadfaa727ac46dd801bc
  11:     0x7f48226e2c4a - check::check_bare_fn::hb43e600383cf2ee2UQn
  12:     0x7f48226e82f9 - check::check_method_body::h033e5d461fd87166Koo
  13:     0x7f48226dfd94 - check::check_item::h77d9b4d4612f23cfF9n
  14:     0x7f48227b4a96 - check_crate::closure.36300
  15:     0x7f48227aee73 - check_crate::h4b0848761f18a2bcbwC
  16:     0x7f48240615cd - driver::phase_3_run_analysis_passes::hf7cad4098b28ceb1gGa
  17:     0x7f4824045425 - driver::compile_input::h7c62c2870ff901f6Qba
  18:     0x7f48240fca25 - run_compiler::hc815b49ce638c28eV4b
  19:     0x7f48240fa33d - boxed::F.FnBox<A>::call_box::h4290333406520961126
  20:     0x7f48240f9879 - rt::unwind::try::try_fn::h13999576404798567721
  21:     0x7f4823a89c68 - rust_try_inner
  22:     0x7f4823a89c55 - rust_try
  23:     0x7f48240f9b4b - boxed::F.FnBox<A>::call_box::h14489442628055152240
  24:     0x7f48239f8781 - sys::thread::create::thread_start::h02b7da32b4d7a4aaExH
  25:     0x7f481d7c7181 - start_thread
  26:     0x7f48235a847c - __clone
  27:                0x0 - <unknown>
@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Apr 13, 2015
@arielb1
Copy link
Contributor

arielb1 commented Apr 13, 2015

Minified:

fn main() {
    1.create_a_type_error[()+()];
}

@arielb1
Copy link
Contributor

arielb1 commented Apr 13, 2015

I think the problem is the rather interesting match in writeback.rs:123. cc @nikomatsakis.

@arielb1
Copy link
Contributor

arielb1 commented Apr 13, 2015

I mean, it says "Hacky Hack".

arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 14, 2015
arielb1 added a commit to arielb1/rust that referenced this issue Apr 15, 2015
@arielb1 arielb1 mentioned this issue Apr 16, 2015
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

Successfully merging a pull request may close this issue.

3 participants