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