]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/expr-block-generic-unique1.rs
Auto merge of #61361 - estebank:infer-type, r=varkor
[rust.git] / src / test / run-pass / expr-block-generic-unique1.rs
1 #![feature(box_syntax)]
2
3 fn test_generic<T, F>(expected: Box<T>, eq: F) where T: Clone, F: FnOnce(Box<T>, Box<T>) -> bool {
4     let actual: Box<T> = { expected.clone() };
5     assert!(eq(expected, actual));
6 }
7
8 fn test_box() {
9     fn compare_box(b1: Box<bool>, b2: Box<bool>) -> bool {
10         println!("{}", *b1);
11         println!("{}", *b2);
12         return *b1 == *b2;
13     }
14     test_generic::<bool, _>(box true, compare_box);
15 }
16
17 pub fn main() { test_box(); }