]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/dyn_trait.rs
Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26
[rust.git] / src / tools / rustfmt / tests / target / dyn_trait.rs
1 #![feature(dyn_trait)]
2
3 fn main() {
4     // #2506
5     // checks rustfmt doesn't remove dyn
6     trait MyTrait {
7         fn method(&self) -> u64;
8     }
9     fn f1(a: Box<dyn MyTrait>) {}
10
11     // checks if line wrap works correctly
12     trait Very_______________________Long__________________Name_______________________________Trait
13     {
14         fn method(&self) -> u64;
15     }
16
17     fn f2(
18         a: Box<
19             dyn Very_______________________Long__________________Name____________________Trait
20                 + 'static,
21         >,
22     ) {
23     }
24
25     // #2582
26     let _: &dyn (::std::any::Any) = &msg;
27 }