Issue 1:
A simple example involving a type alias, a nested type, and Fn causes an ICE.

I tried this code:

struct C<A> { a: A }

type T<A, B> = C<Fn(A) -> B>;

fn id<A, B>(t: T<&A, B>) -> T<&A, B> { t }

I expected to see either no error, or at most an error about lifetime elision.

Instead, when compiled with rustc --crate-type=lib I get an ICE. The effect persists when C is replaced by Box, but disappears if Fn is replaced by another two-parameter type.

The ICE:

error: internal compiler error: unexpected panic
thread 'rustc' panicked at
'assertion failed: !predicates.has_escaping_regions()',
/build/rust/src/rustc-1.0.0/src/librustc_typeck/check/mod.rs:1698

The backtrace output is:

stack backtrace:
1: 0x7f892d092189 - sys::backtrace::write::h85e36588f6ec519ed4r
2: 0x7f892d099e96 - <unknown>
3: 0x7f892d05d1a2 - rt::unwind::begin_unwind_inner::h58d8677c31c147e6t6v
4: 0x7f892be6090e - <unknown>
5: 0x7f892bead693 - <unknown>
6: 0x7f892bee43d1 - check::wf::BoundsChecker<'cx, 'tcx>.TypeFolder<'tcx>::fold_ty::hf49f58e50ffe027105k
7: 0x7f892bee619b - <unknown>
8: 0x7f892bee46c8 - check::wf::BoundsChecker<'cx, 'tcx>.TypeFolder<'tcx>::fold_ty::hf49f58e50ffe027105k
9: 0x7f892bedb8d7 - <unknown>
10: 0x7f892bfc628d - <unknown>
11: 0x7f892bfc16e0 - check_crate::h5570390160d0735dXcC
12: 0x7f892d5cca18 - driver::phase_3_run_analysis_passes::h8472d32b1f7cb2d6nGa
13: 0x7f892d5adb15 - driver::compile_input::hee759950e4b56686Qba
14: 0x7f892d66efe1 - run_compiler::h57ce534eedce4c58z4b
15: 0x7f892d66cc32 - <unknown>
16: 0x7f892d66c169 - <unknown>
17: 0x7f892d103b28 - <unknown>
18: 0x7f892d103b15 - rust_try
19: 0x7f892d66c418 - <unknown>
20: 0x7f892d098d81 - <unknown>
21: 0x7f8927b22373 - start_thread
22: 0x7f892ccf227c - clone
23: 0x0 - <unknown>

The output of rustc --version --verbose is:

rustc 1.0.0-beta.5 (built 2015-05-16)
binary: rustc
commit-hash: unknown
commit-date: unknown
build-date: 2015-05-16
host: x86_64-unknown-linux-gnu
release: 1.0.0-beta.5

Issue 2:
Compiler panic. Found an ealier issue in the same file that had been closed because the problem had gone away in later compiles. This is the stable 1.1 though.

Version info

rustc 1.1.0 (35ceea3 2015-06-19)

binary: rustc

commit-hash: 35ceea3

commit-date: 2015-06-19

host: x86_64-pc-windows-gnu

release: 1.1.0

RUST_BACKTRACE=1 rustc --verbose src/main.rs

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: run with RUST_BACKTRACE=1 for a backtrace

thread 'rustc' panicked at 'assertion failed: !self.has_escaping_regions()', C:/bot/slave/stable-dist-rustc-win-gnu-64/build/src/librustc\middle\ty.rs:2123

stack backtrace:

1: 0x6f138a02 - sys::backtrace::write::hb142593d131303b10fs

2: 0x6f141e76 - rt::unwind::register::h2f2891f465b0e536sNv

3: 0x6f1053c0 - rt::unwind::begin_unwind_inner::he5d025d7f655ecaaCKv

4: 0x6d08989e - middle::astencode::rbml..Doc<'a>.doc_decoder_helpers::opt_child::hd6aba4d7b00f0fc9UKb

5: 0x6d1c0773 - middle::traits::fulfill::FulfillmentContext<'tcx>::register_builtin_bound::h1fba927ecfad50a9DEO

6: 0x6a93c978 - check::FnCtxt<'a, 'tcx>.mc..Typer<'tcx>::is_method_call::hb206e83d494db5a0Akn

7: 0x6a948ac8 - check::FnCtxt<'a, 'tcx>.AstConv<'tcx>::projected_ty::he778b71de0699925wAo

8: 0x6a95effc - check::CheckItemBodiesVisitor<'a, 'tcx>.Visitor<'tcx>::visit_item::h49b5aaa3aec9c80dWrn

9: 0x6a95d1df - check::CheckItemBodiesVisitor<'a, 'tcx>.Visitor<'tcx>::visit_item::h49b5aaa3aec9c80dWrn

10: 0x6aa187ab - check_crate::hf98f1f239eb0b1afsJC

11: 0x6aa11f75 - check_crate::hf98f1f239eb0b1afsJC

12: 0x6701f3dd - driver::phase_3_run_analysis_passes::h5d9dbc988e0fcdbatGa

13: 0x67002b40 - driver::compile_input::h66ba80b489f2ef28Qba

14: 0x670b5913 - run_compiler::hf1308c7d75cfa1a775b

15: 0x670b349f - run::h99d8d2bce2d42189N5b

16: 0x670b2a59 - run::h99d8d2bce2d42189N5b

17: 0x6f17b5bc - rust_try

18: 0x6f17b599 - rust_try

19: 0x670b2cd5 - run::h99d8d2bce2d42189N5b

20: 0x6f140134 - sys::process::Command::cwd::hecbd2393e1ca7c52luu

21: 0x776659cd - BaseThreadInitThunk