2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2014-11-06 00:06:28 -08:00
|
|
|
// Test that param substitutions from the correct environment are
|
2018-05-08 16:10:16 +03:00
|
|
|
// used when codegenning unboxed closure calls.
|
2014-11-06 00:06:28 -08:00
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2014-11-06 00:06:28 -08:00
|
|
|
pub fn inside<F: Fn()>(c: F) {
|
2015-12-02 17:31:49 -08:00
|
|
|
c();
|
2014-11-06 00:06:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Use different number of type parameters and closure type to trigger
|
|
|
|
|
// an obvious ICE when param environments are mixed up
|
|
|
|
|
pub fn outside<A,B>() {
|
2015-02-01 12:44:15 -05:00
|
|
|
inside(|| {});
|
2014-11-06 00:06:28 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
outside::<(),()>();
|
|
|
|
|
}
|