-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE type of value must be know in this context #20506
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
Labels
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
I believe I'm also affected. OS: Arch Linux
Backtrace:
test.rs: fn main() {
let mut arr = range(0, 10u).map(|_| 0.0f64).collect();
let mut sum = 0.0f64;
for j in range(0, 10u) {
arr[j] = 0.0f64;
sum += arr[j];
}
} |
Here's yet another small code that triggers it: use std::default::Default;
type new_progress = [u8; 5];
fn main() { }
fn combine_progress(a : [u8; 5], b : [u8; 5]) -> [u8; 5] {
let mut new_progress = Default::default();
for i in range(new_progress.len()) {
new_progress[i] = std::cmp::max(a[i], b[i]);
}
new_progress
} Output:ice_no_type.rs:9:18: 9:43 error: this function takes 2 parameters but 1 parameter was supplied [E0061] ice_no_type.rs:9 for i in range(new_progress.len()) { ^~~~~~~~~~~~~~~~~~~~~~~~~ ice_no_type.rs:9:24: 9:42 error: the type of this value must be known in this context ice_no_type.rs:9 for i in range(new_progress.len()) { ^~~~~~~~~~~~~~~~~~ error: internal compiler error: no type for node 51: expr i (id=51) in fcx 0x106fee718 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 thread 'rustc' panicked at 'Box', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:182 stack backtrace: 1: 0x1058f45e5 - sys::backtrace::write::h98e4664f4f31dc8eiTs 2: 0x105919f4f - failure::on_fail::h15cffea110d6009eKVy 3: 0x10587f40a - rt::unwind::begin_unwind_inner::h9de529c6f705175fKDy 4: 0x103577dc7 - rt::unwind::begin_unwind::h8742058877264024887 5: 0x103578738 - diagnostic::Handler::bug::h7bcbd2439c55014b0qF 6: 0x102b4d3b8 - session::Session::bug::h59b8be8232d1ea9aBWp 7: 0x1025cfc02 - check::FnCtxt<'a, 'tcx>::node_ty::h7c722fd7bb1fc88dRzl 8: 0x1025e5bea - check::writeback::WritebackCx<'cx, 'tcx>::visit_node_id::h7a203c9d76d14e1epDb 9: 0x1025e09e3 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::hfe8b1d3bea2ca17bptb 10: 0x1025e440f - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_block::h7503b694ee05563dEub 11: 0x1025e440f - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_block::h7503b694ee05563dEub 12: 0x10267c5da - check::check_bare_fn::h9b4971f57fc7a4312sj 13: 0x1026731cd - check::check_item::h8df47e8e18e344abOLj 14: 0x10275f4f0 - check_crate::unboxed_closure.39887 15: 0x10275ad53 - check_crate::hbc0ab8570a19149famx 16: 0x10208d292 - driver::phase_3_run_analysis_passes::h61da41ec58961d9bSva 17: 0x102079cac - driver::compile_input::h6ba151de4af50ce2vba 18: 0x10213cc13 - thunk::F.Invoke::invoke::h15890902738341362910 19: 0x102139d70 - rt::unwind::try::try_fn::h15939753852117214544 20: 0x10597f009 - rust_try_inner 21: 0x10597eff6 - rust_try 22: 0x10213a4b6 - thunk::F.Invoke::invoke::h14011449182044061502 23: 0x105905a34 - sys::thread::thread_start::h4e93ea2350249d53kGv 24: 0x7fff932fe2fc - _pthread_body 25: 0x7fff932fe279 - _pthread_body Configuration:rustc 0.13.0-nightly (c7dd3c4d6 2015-01-05 23:51:00 +0000) binary: rustc commit-hash: c7dd3c4d69aee1c4ad8cc220c194b176bba2ab62 commit-date: 2015-01-05 23:51:00 +0000 host: x86_64-apple-darwin release: 0.13.0-nightly |
barosl
added a commit
to barosl/rust
that referenced
this issue
Jan 11, 2015
If the type of a node cannot be determined due to a previous type error, a "no type for node" ICE occurs. This commit makes it return ty_err instead in such a case. Fixes rust-lang#20401. Fixes rust-lang#20506. Fixes rust-lang#20614. Fixes rust-lang#20752. Fixes rust-lang#20829. Fixes rust-lang#20846. Fixes rust-lang#20885. Fixes rust-lang#20886.
bors
added a commit
that referenced
this issue
Jan 12, 2015
If the type of a node cannot be determined due to a previous type error, a `no type for node` ICE occurs. This commit makes it return `ty_err` instead in such a case. Fixes #20401. Fixes #20506. Fixes #20614. Fixes #20752. Fixes #20829. Fixes #20846. Fixes #20885. Fixes #20886. Fixes #20952. Fixes #20970.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Arch linux
The text was updated successfully, but these errors were encountered: