]> git.lizzy.rs Git - rust.git/blob - tests/ui/expr-block-generic-unique2.rs
add (currently ICEing) test
[rust.git] / tests / ui / expr-block-generic-unique2.rs
1 // run-pass
2 #![allow(unused_braces)]
3
4 fn test_generic<T, F>(expected: T, eq: F) where T: Clone, F: FnOnce(T, T) -> bool {
5     let actual: T = { expected.clone() };
6     assert!(eq(expected, actual));
7 }
8
9 fn test_vec() {
10     fn compare_vec(v1: Box<isize>, v2: Box<isize>) -> bool { return v1 == v2; }
11     test_generic::<Box<isize>, _>(Box::new(1), compare_vec);
12 }
13
14 pub fn main() { test_vec(); }