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