mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
11 lines
298 B
Rust
11 lines
298 B
Rust
fn let_in<T, F>(x: T, f: F) where F: FnOnce(T) {}
|
|
|
|
fn main() {
|
|
let_in(3u32, |i| { assert!(i == 3i32); });
|
|
//~^ ERROR mismatched types
|
|
//~| expected `u32`, found `i32`
|
|
|
|
let_in(3i32, |i| { assert!(i == 3u32); });
|
|
//~^ ERROR mismatched types
|
|
//~| expected `i32`, found `u32`
|
|
}
|