]> git.lizzy.rs Git - rust.git/blob - src/test/ui/non-legacy-modes.rs
Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyup
[rust.git] / src / test / ui / non-legacy-modes.rs
1 // run-pass
2
3 struct X {
4     repr: isize
5 }
6
7 fn apply<T, F>(x: T, f: F) where F: FnOnce(T) {
8     f(x);
9 }
10
11 fn check_int(x: isize) {
12     assert_eq!(x, 22);
13 }
14
15 fn check_struct(x: X) {
16     check_int(x.repr);
17 }
18
19 pub fn main() {
20     apply(22, check_int);
21     apply(X {repr: 22}, check_struct);
22 }