Closed
Description
$ RUST_BACKTRACE=1 cargo build
Compiling tclscan v0.0.1 (file:///home/aidanhs/rust/tclscan)
/home/aidanhs/rust/tclscan/src/main.rs:23:22: 23:34 error: attempted access of field `ArgvMap` on type `Args`, but no field with that name was found
/home/aidanhs/rust/tclscan/src/main.rs:23 let take_stdin = args.ArgvMap["-"];
^~~~~~~~~~~~
error: internal compiler error: no type for node 250: expr "-" (id=250) in fcx 0x7fbb7afebc68
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/aidanhs/rust/rust/src/libsyntax/diagnostic.rs:182
stack backtrace:
1: 0x7fbb82a8d6b0 - sys::backtrace::write::h45e4a5c1a13bb3468Rt
2: 0x7fbb82aaf150 - failure::on_fail::h49ea64be233d5ff7k8z
3: 0x7fbb82a1dd00 - rt::unwind::begin_unwind_inner::h269b0cb77adc909bcNz
4: 0x7fbb7daef910 - rt::unwind::begin_unwind::h9484920305264525146
5: 0x7fbb7daf01b0 - diagnostic::Handler::bug::haa1a07a4c33aa66btWF
6: 0x7fbb80d8e610 - session::Session::bug::hded4db1f83514fa5ETq
7: 0x7fbb821a7140 - check::FnCtxt<'a, 'tcx>::node_ty::hc014d4b6376982aaRcm
8: 0x7fbb821d6620 - middle::mem_categorization::MemCategorizationContext<'t, TYPER>::cat_expr_unadjusted::h11968388842244901477
9: 0x7fbb821d74e0 - middle::mem_categorization::MemCategorizationContext<'t, TYPER>::cat_expr::h12238244667137168951
10: 0x7fbb822196e0 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::consume_expr::h4490449580609183048
11: 0x7fbb82216e30 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_expr::h4171668758978992957
12: 0x7fbb82216940 - middle::expr_use_visitor::ExprUseVisitor<'d, 't, 'tcx, TYPER>::walk_block::h12980838698167173709
13: 0x7fbb82210150 - check::upvar::AdjustBorrowKind<'a, 'tcx>::analyze_fn::hff9b7b8bc9cbab54vji
14: 0x7fbb8223b270 - check::check_bare_fn::h6932e2ad6c2c068013j
15: 0x7fbb82233510 - check::check_item::h0a5f7f6fd4eb2caeOmk
16: 0x7fbb822ffdb0 - check_crate::unboxed_closure.30794
17: 0x7fbb822fa970 - check_crate::hdd431d95783baf8avay
18: 0x7fbb82fe3770 - driver::phase_3_run_analysis_passes::h82e70f1cc5c26fdfgwa
19: 0x7fbb82fcbd90 - driver::compile_input::h743c002cd7915502xba
20: 0x7fbb830963b0 - monitor::unboxed_closure.22508
21: 0x7fbb83096290 - thunk::F.Invoke<A, R>::invoke::h16747943875488918271
22: 0x7fbb830951f0 - rt::unwind::try::try_fn::h18356863736036389421
23: 0x7fbb82b14e70 - rust_try_inner
24: 0x7fbb82b14e60 - rust_try
25: 0x7fbb830954a0 - thunk::F.Invoke<A, R>::invoke::h244180221950939313
26: 0x7fbb82a9d0a0 - sys::thread::thread_start::h0e2004bfb6807920VJw
27: 0x7fbb7d30f0c0 - start_thread
28: 0x7fbb826c0ec9 - __clone
29: 0x0 - <unknown>
Could not compile `tclscan`.
To learn more, run the command again with --verbose.
extern crate "rustc-serialize" as rustc_serialize;
extern crate docopt;
extern crate tclscan;
use std::os;
use docopt::Docopt;
use tclscan::rstcl;
static USAGE: &'static str = "
Usage: tclscan check [ <path> | - ]
tclscan parsestr -
";
#[derive(RustcDecodable, Show)]
struct Args {
cmd_check: bool,
cmd_parsestr: bool,
arg_path: String,
}
pub fn main() {
let args = os::args();
let args: Args = Docopt::new(USAGE).and_then(|d| d.decode()).unwrap_or_else(|e| e.exit());
let take_stdin = args.ArgvMap["-"];
match (args.cmd_check, args.cmd_parsestr, take_stdin) {
(true, false, false) => tclscan::scan_file(args.arg_path.as_slice()),
(false, true, false) => tclscan::scan_script(args.arg_path.as_slice()),
_ => panic!("Internal error, cannot handle args"),
}
}