graydon/rust — Issue #1283: Unresolvable names in other modules fail hard
Author: jdm
Created: 2011-12-10 06:30:09+00:00
State: open
Labels: bug, middle, typeck, unassigned

```rust
import std::json;
use std;

fn foo() {
}

fn main() {
foo();
}
```

yields

```
godot:build jdm$ x86_64-apple-darwin/stage2/bin/rustc ~/src/resolve_test.rs
rust: upcall fail 'option none', ../src/libstd/option.rs:34
rust: domain main @0x10202fa00 root task failed
```

backtrace:
```
#0 upcall_fail (expr=0x103211420 "option none", file=0x10065cb20 "../src/libstd/option.rs", line=34) at ../src/rt/rust_upcall.cpp:68
#1 0x00000001005ed507 in option::get::_c611c1485a7070e4 ()
#2 0x000000010064a612 in map::chained::o::method::get ()
#3 0x0000000100116353 in middle::resolve::unresolved_err::_7f105549e49dc31f ()
#4 0x000000010011cfea in middle::resolve::lookup_in_mod_strict::_09da68e4396c796f ()
#5 0x0000000100117d1f in middle::resolve::lookup_path_strict::_6073bcd296e7304d ()
#6 0x000000010010dd56 in middle::resolve::resolve_names::walk_expr::_eaa67a48e19ee441 ()
#7 0x0000000100379159 in middle::resolve::resolve_names::thunk3019 ()
#8 0x00000001002024fe in syntax::visit::visit_expr::_479f4c3055d95dbe ()
#9 0x00000001001115b9 in middle::resolve::visit_expr_with_scope::_95d69bdbdaae56ff ()
#10 0x000000010010dc87 in middle::resolve::resolve_names::walk_expr::_eaa67a48e19ee441 ()
#11 0x0000000100379159 in middle::resolve::resolve_names::thunk3019 ()
#12 0x00000001002024b1 in syntax::visit::visit_expr::_479f4c3055d95dbe ()
#13 0x00000001001115b9 in middle::resolve::visit_expr_with_scope::_95d69bdbdaae56ff ()
#14 0x000000010010dc87 in middle::resolve::resolve_names::walk_expr::_eaa67a48e19ee441 ()
#15 0x0000000100379159 in middle::resolve::resolve_names::thunk3019 ()
#16 0x00000001002013b7 in syntax::visit::visit_stmt::_988d6888c7f17136 ()
#17 0x00000001003a92b9 in syntax::visit::default_visitor::thunk6355 ()
#18 0x000000010011098d in middle::resolve::visit_block_with_scope::_eb629d0a1711e9fd ()
#19 0x00000001002010d5 in syntax::visit::visit_fn::_138d673aeee56f5c ()
#20 0x00000001001102f5 in middle::resolve::visit_fn_with_scope::_2a7daba5e232135a ()
#21 0x00000001003792ae in middle::resolve::resolve_names::thunk3022 ()
#22 0x00000001001ff667 in syntax::visit::visit_item::_8c9c8c12eba1ca5e ()
#23 0x000000010010fa4e in middle::resolve::visit_item_with_scope::_8c66e6b6f4ad8a18 ()
#24 0x00000001001ff098 in syntax::visit::visit_mod::_7a2872428395f5b8 ()
#25 0x00000001003a90d5 in syntax::visit::default_visitor::thunk6349 ()
#26 0x00000001001fed7b in syntax::visit::visit_crate::_ba15f3acc7b2f869 ()
#27 0x000000010010f697 in middle::resolve::resolve_names::_66b1ebb395db75b6 ()
#28 0x00000001001093fa in middle::resolve::resolve_crate::_bed42f8782ca2a64 ()
#29 0x00000001003de419 in driver::rustc::compile_input::thunk9378 ()
#30 0x000000010031d574 in driver::rustc::time::_3e691b2a4ba58aee ()
#31 0x0000000100321198 in driver::rustc::compile_input::_e341d1aadf1f04bd ()
#32 0x0000000100338e3e in driver::rustc::main::_cd8b8c8185af3dee ()
#33 0x00000001003392cd in _rust_main ()
#34 0x0000000101928d2b in task_start_wrapper (a=0x101e10004) at ../src/rt/rust_task.cpp:176
#35 0x00000000deadbeef in ?? ()
#36 0x000000010192d8f3 in rust_kernel::start_task_threads (this=0x101e10004) at ../src/rt/rust_kernel.cpp:131
#37 0x0000000101922b37 in rust_start (main_fn=4298347168, argc=, argv=, crate_map=0x2) at ../src/rt/rust.cpp:105
#38 0x0000000100339301 in main ()
```