This code: https://github.com/rust-lang/rust/blob/994cdd918589535d705177545bf503cd0c3c5148/src/librustc_mir/transform/inline.rs#L96-L97 should not pattern-match on `func`, but rather call its `ty` method to get its type. What this means is that `let f = foo; f();` should inline as well as `foo()` (but today it doesn't). cc @nikomatsakis