Issue 1:
If you look at the iter branch in the nikomatsakis/rust repo, you will find that it fails in stage0. I debugged this a bit by building a vanilla compiler in another repoistory and managed to trace it as far as a failure in make_mono_id() because the call to map2() that is processing bounds and substs receives a bounds vec of length 1 and a substs vec of length 2. This seems to occur with the call to vec::flatmap() that occurs in librustsyntax processing the attributes. I tried to narrow down the test to a smaller test file but was unable to find anything that reproduced the error other than the full rustc.

@marijnh if you wouldn't mind taking a look and let me know if something jumps out at you, I would appreciate it.

Issue 2:
Compiling following source, rustc dumps core with error messages.

import iter::*;

fn main() {
let range = bind uint::range(0u, 1000u, _);
let filt = bind iter::filter(range, {|&&n: uint| n % 3u != 0u && n % 5u != 0u }, _);
let sum = iter::foldl(filt, 0u) {|accum, &&n: uint| accum + n };

io::println(#fmt("%u", sum));
}

$ rustc foo.rs
error: internal compiler error unexpected failure
note: The compiler hit an unexpected failure path. This is a bug. Try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
leaked memory in rust main loop (1 objects)
Assertion failed: (false), function ~memory_region, file ../src/rt/memory_region.cpp, line 172.
zsh: abort (core dumped) rustc foo.rs

$ RUST_LOG=rustc=0,::rt::backtrace rustc foo.rs
rust: upcall fail 'explicit failure', ../src/rustc/rustc.rc:1
0x802197914 <_ZN9rust_task15call_on_c_stackEPvS0_+148> at /usr/local/bin/../lib/librustrt.so @&N0x8021986ed <upcall_fail+141> at /usr/local/bin/../lib/librustrt.so
�\0x8018dc7de <_ZN6middle2ty16lookup_item_type17_f614ca4c755aeba7202E+846> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so �0x8018dbde1 <_ZN6middle5trans4base12make_mono_id17_f2ebd2e452b417a6202E+257> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x8018c7568 <_ZN6middle5trans4base14monomorphic_fn17_77d7254b93f76bc2202E+472> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
0x8018ee718 <_ZN6middle5trans4base20lval_static_fn_inner17_f1ee6671c5727412202E+488> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
��0x80193daf7 <_ZN6middle5trans4impl26trans_monomorphized_callee17_397545b5c646b954202E+999> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x8018d0f06 <_ZN6middle5trans4impl19trans_method_callee17_6b1587f014518324202E+470> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
@@�0x8018f61c4 <_ZN6middle5trans4base12trans_callee17_ed5afa7c661e67af202E+484> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x801901487 <_ZN6middle5trans4base10with_scope17_13d2b9fa8bfa3e3f202E+583> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x801b7e11c <_ZN3lib4llvm16section_iter_res4dtor17_3815581a5148d851202E+396> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x80190141c <_ZN6middle5trans4base10with_scope17_13d2b9fa8bfa3e3f202E+476> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x8018d0c96 <_ZN6middle5trans4base16trans_call_inner17_e4ab2a25f8e56a47202E+390> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so @�0x8018fdf12 <_ZN6middle5trans4base10trans_call17_f759ff632d924a7a202E+258> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x8018d1c83 <_ZN6middle5trans4base10trans_expr17_2f49fb6e59efc0cc202E+3187> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x80190a00f <_ZN6middle5trans4base10trans_stmt17_dda29e9b5a06725d202E+1103> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x8018d9fbf <_ZN6middle5trans4base11trans_block17_5d538f556387313f202E+303> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x80190d9ed <_ZN6middle5trans4base13trans_closure17_f68d7bace7a25795202E+1197> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
0x8018e636d <_ZN6middle5trans4base8trans_fn17_30737349273ebd1b202E+461> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so 0x8018c8122 <_ZN6middle5trans4base14monomorphic_fn17_77d7254b93f76bc2202E+3474> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
@�0x8018ee718 <_ZN6middle5trans4base20lval_static_fn_inner17_f1ee6671c5727412202E+488> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
��0x8018ee272 <_ZN6middle5trans4base14lval_static_fn17_97c1e6b66444e182202E+418> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
0x8018f472d <_ZN6middle5trans4base9trans_var17_7c5ea379277185b4202E+205> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so �0x8018f4556 <_ZN6middle5trans4base10trans_path17_c674ef35f426c629202E+198> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x8018f608b <_ZN6middle5trans4base12trans_callee17_ed5afa7c661e67af202E+171> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x801901487 <_ZN6middle5trans4base10with_scope17_13d2b9fa8bfa3e3f202E+583> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x8019012e7 <_ZN6middle5trans4base10with_scope17_13d2b9fa8bfa3e3f202E+167> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x8018d0c96 <_ZN6middle5trans4base16trans_call_inner17_e4ab2a25f8e56a47202E+390> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so @��0x8018fdf12 <_ZN6middle5trans4base10trans_call17_f759ff632d924a7a202E+258> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x8018d1c83 <_ZN6middle5trans4base10trans_expr17_2f49fb6e59efc0cc202E+3187> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x801b7e11c <_ZN3lib4llvm16section_iter_res4dtor17_3815581a5148d851202E+396> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x8018d103c <_ZN6middle5trans4base10trans_expr17_2f49fb6e59efc0cc202E+44> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x8019083ad <_ZN6middle5trans4base10init_local17_17d57dd23a569e54202E+333> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x80190a1b5 <_ZN6middle5trans4base10trans_stmt17_dda29e9b5a06725d202E+1525> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x80190a0ab <_ZN6middle5trans4base10trans_stmt17_dda29e9b5a06725d202E+1259> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x8018d9fbf <_ZN6middle5trans4base11trans_block17_5d538f556387313f202E+303> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x80190d9ed <_ZN6middle5trans4base13trans_closure17_f68d7bace7a25795202E+1197> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
0x8018e636d <_ZN6middle5trans4base8trans_fn17_30737349273ebd1b202E+461> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so 0x8018ec8bb <_ZN6middle5trans4base10trans_item17_28e452dae21c3667202E+1883> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x801911e94 <_ZN6middle5trans4base9trans_mod17_384418731efae2e8202E+260> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so �0x80191dc28 <_ZN6middle5trans4base11trans_crate17_6616cfe44b3b9bb3202E+4600> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x801b7e11c <_ZN3lib4llvm16section_iter_res4dtor17_3815581a5148d851202E+396> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x80191ca5c <_ZN6middle5trans4base11trans_crate17_6616cfe44b3b9bb3202E+44> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�\0x801b7e11c <_ZN3lib4llvm16section_iter_res4dtor17_3815581a5148d851202E+396> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so
�0x801b6182c <_ZN6driver6driver12compile_upto17_40784acf6e567faf202E+44> at /usr/local/bin/../lib/librustc-688fa7810161fd45-0.2.so 0x403f6a <_init+8218> at /usr/local/bin/rustc
@0�0x407818 <_rust_main+1464> at /usr/local/bin/rustc �0x402f1c <_init+4044> at /usr/local/bin/rustc
@��0x406878 <_init+18728> at /usr/local/bin/rustc
@�0x80089e675 <_ZN4task11get_task_id17_42c92e624d84fbbc202E+149> at /usr/local/bin/../lib/libcore-d27e4777a53c3e50-0.2.so
�0x802196735 <_Z18task_start_wrapperP10spawn_args+37> at /usr/local/bin/../lib/librustrt.so
@`�error: internal compiler error unexpected failure
note: The compiler hit an unexpected failure path. This is a bug. Try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: upcall fail 'explicit failure', ../src/rustc/driver/rustc.rs:187
0x802197914 <_ZN9rust_task15call_on_c_stackEPvS0_+148> at /usr/local/bin/../lib/librustrt.so @cM0x8021986ed <upcall_fail+141> at /usr/local/bin/../lib/librustrt.so
�\0x406388 <_init+17464> at /usr/local/bin/rustc
�F0x407818 <_rust_main+1464> at /usr/local/bin/rustc �0x405cdc <_init+15756> at /usr/local/bin/rustc
�E0x802196735 <_Z18task_start_wrapperP10spawn_args+37> at /usr/local/bin/../lib/librustrt.so
@�Erust: domain main @0x80443a810 root task failed
leaked memory in rust main loop (1 objects)
Assertion failed: (false), function ~memory_region, file ../src/rt/memory_region.cpp, line 172.
zsh: abort (core dumped) RUST_LOG=rustc=0,::rt::backtrace rustc foo.rs