Closed
Description
Arch linux
rustc 0.13.0-nightly (c89417130 2015-01-02 21:56:13 +0000)
binary: rustc
commit-hash: c89417130f042c58adc60012e7cddc4ef70b70b9
commit-date: 2015-01-02 21:56:13 +0000
host: x86_64-unknown-linux-gnu
release: 0.13.0-nightly
use std::io;
struct Dice {
num: uint,
size: uint,
}
fn parse_input(input: &str) -> Dice {
let results = input.split('d').map(|num| num.parse::<uint>()).collect();
println!("{}", results);
Dice {num: results[0], size: results[1]}
}
fn main() {
let input = io::stdin.read_line().ok();
let a = parse_input(input);
println!("{}", a.num);
}
main.rs:11:16: 11:26 error: the type of this value must be known in this context
main.rs:11 Dice {num: results[0], size: results[1]}
^~~~~~~~~~
error: internal compiler error: no type for node 48: expr 1 (id=48) in fcx 0x7f3de57ec4b8
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<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:182
stack backtrace:
1: 0x7f3ded0423e0 - sys::backtrace::write::h07654db4c803799asit
2: 0x7f3ded067c10 - failure::on_fail::hcaec3177bc42e928Tuz
3: 0x7f3decfcd2d0 - rt::unwind::begin_unwind_inner::hb226e8b72f3e677ey9y
4: 0x7f3de8152e30 - rt::unwind::begin_unwind::h4014735294015536206
5: 0x7f3de81536e0 - diagnostic::Handler::bug::h05b38468732b1c1dzLF
6: 0x7f3deb1fbb30 - session::Session::bug::h6e1b76961f7f6c6eh8p
7: 0x7f3dec610a40 - check::FnCtxt<'a, 'tcx>::node_ty::h148c45f33d9b05bbhul
8: 0x7f3dec625f10 - check::writeback::WritebackCx<'cx, 'tcx>::visit_node_id::haedae18a10f6507bGDb
9: 0x7f3dec6221a0 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::h91e8e5224f7dbfd6Gtb
10: 0x7f3dec6221a0 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::h91e8e5224f7dbfd6Gtb
11: 0x7f3dec6ebb20 - check::check_bare_fn::h8ccefd5610a5a146goj
12: 0x7f3dec6e30c0 - check::check_item::h39fb2bbe81c824a9SGj
13: 0x7f3dec8839d0 - check_crate::unboxed_closure.39848
14: 0x7f3dec87e620 - check_crate::hb52a41bcb9b55409Vlx
15: 0x7f3ded592620 - driver::phase_3_run_analysis_passes::h33329f43054c2979Tva
16: 0x7f3ded580ac0 - driver::compile_input::h88016b50923aff2bwba
17: 0x7f3ded64be00 - thunk::F.Invoke<A, R>::invoke::h18199457566815101468
18: 0x7f3ded64abb0 - rt::unwind::try::try_fn::h5958693639131164017
19: 0x7f3ded0ce510 - rust_try_inner
20: 0x7f3ded0ce500 - rust_try
21: 0x7f3ded64af00 - thunk::F.Invoke<A, R>::invoke::h2060855259774067648
22: 0x7f3ded053f50 - sys::thread::thread_start::hb5d2265d5cf58673y8v
23: 0x7f3de7977250 - start_thread
24: 0x7f3decc83219 - clone
25: 0x0 - <unknown>