]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/issue-65041-empty-vis-matcher-in-enum.rs
Merge commit '0969bc6dde001e01e7e1f58c8ccd7750f8a49ae1' into sync_cg_clif-2021-03-29
[rust.git] / src / test / ui / parser / issue-65041-empty-vis-matcher-in-enum.rs
1 // check-pass
2
3 // Here we check that a `:vis` macro matcher subsititued for the empty visibility
4 // (`VisibilityKind::Inherited`) is accepted when used before an enum variant.
5
6 fn main() {}
7
8 macro_rules! mac_variant {
9     ($vis:vis MARKER) => {
10         enum Enum {
11             $vis Unit,
12
13             $vis Tuple(u8, u16),
14
15             $vis Struct { f: u8 },
16         }
17     }
18 }
19
20 mac_variant!(MARKER);
21
22 // We also accept visibilities on variants syntactically but not semantically.
23 #[cfg(FALSE)]
24 enum E {
25     pub U,
26     pub(crate) T(u8),
27     pub(super) T { f: String }
28 }