summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/dyn_trait.rs
blob: b6e2810a57cb5faa7f7705c7dcdf80a176ee7b52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#![feature(dyn_trait)]

fn main() {
    // #2506
    // checks rustfmt doesn't remove dyn
    trait MyTrait {
        fn method(&self) -> u64;
    }
    fn f1(a: Box<dyn MyTrait>) {}

    // checks if line wrap works correctly
    trait Very_______________________Long__________________Name_______________________________Trait
    {
        fn method(&self) -> u64;
    }

    fn f2(
        a: Box<
            dyn Very_______________________Long__________________Name____________________Trait
                + 'static,
        >,
    ) {
    }

    // #2582
    let _: &dyn (::std::any::Any) = &msg;
}