summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/skip_macro_invocations/use_alias_examples.rs
blob: 43cb8015de58a04a0a45dbe825b52d394d928256 (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
28
29
30
31
32
// rustfmt-skip_macro_invocations: ["aaa","ccc"]

// These tests demonstrate a realistic use case with use aliases.
// The use statements should not impact functionality in any way.

use crate::{aaa, bbb, ddd};

// No use alias, invocation in list
// Should skip this invocation
aaa!(
        const _: u8 = 0;
);

// Use alias, invocation in list
// Should skip this invocation
use crate::bbb as ccc;
ccc!(
        const _: u8 = 0;
);

// Use alias, invocation not in list
// Should not skip this invocation
use crate::ddd as eee;
eee!(
        const _: u8 = 0;
);

// No use alias, invocation not in list
// Should not skip this invocation
fff!(
        const _: u8 = 0;
);