]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/expr-match-generic-unique2.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / binding / expr-match-generic-unique2.rs
1 // run-pass
2
3 fn test_generic<T: Clone, F>(expected: T, eq: F) where F: FnOnce(T, T) -> bool {
4     let actual: T = match true {
5         true => expected.clone(),
6         _ => panic!("wat")
7     };
8     assert!(eq(expected, actual));
9 }
10
11 fn test_vec() {
12     fn compare_box(v1: Box<isize>, v2: Box<isize>) -> bool { return v1 == v2; }
13     test_generic::<Box<isize>, _>(Box::new(1), compare_box);
14 }
15
16 pub fn main() { test_vec(); }