rust/tests/ui/pptypedef.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
298 B
Rust
Raw Normal View History

2015-01-03 23:45:00 +08:00
fn let_in<T, F>(x: T, f: F) where F: FnOnce(T) {}
2012-05-05 03:33:04 +08:00
fn main() {
2015-02-01 00:23:42 +08:00
let_in(3u32, |i| { assert!(i == 3i32); });
2015-01-12 14:01:44 +08:00
//~^ ERROR mismatched types
//~| expected `u32`, found `i32`
2015-02-01 00:23:42 +08:00
let_in(3i32, |i| { assert!(i == 3u32); });
2015-01-12 14:01:44 +08:00
//~^ ERROR mismatched types
//~| expected `i32`, found `u32`
}