2015-01-03 10:45:00 -05:00
|
|
|
fn let_in<T, F>(x: T, f: F) where F: FnOnce(T) {}
|
2012-05-04 12:33:04 -07:00
|
|
|
|
|
|
|
fn main() {
|
2015-01-31 17:23:42 +01:00
|
|
|
let_in(3u32, |i| { assert!(i == 3i32); });
|
2015-01-12 01:01:44 -05:00
|
|
|
//~^ ERROR mismatched types
|
2019-11-15 09:37:01 -08:00
|
|
|
//~| expected `u32`, found `i32`
|
2014-02-21 15:41:51 -08:00
|
|
|
|
2015-01-31 17:23:42 +01:00
|
|
|
let_in(3i32, |i| { assert!(i == 3u32); });
|
2015-01-12 01:01:44 -05:00
|
|
|
//~^ ERROR mismatched types
|
2019-11-15 09:37:01 -08:00
|
|
|
//~| expected `i32`, found `u32`
|
2013-02-14 11:47:00 -08:00
|
|
|
}
|