1fad3a1d3Sopenharmony_cimacro_rules! should_parse {
2fad3a1d3Sopenharmony_ci    ($name:ident, { $($in:tt)* }) => {
3fad3a1d3Sopenharmony_ci        #[test]
4fad3a1d3Sopenharmony_ci        fn $name() {
5fad3a1d3Sopenharmony_ci            // Make sure we can parse the file!
6fad3a1d3Sopenharmony_ci            syn::parse_file(stringify!($($in)*)).unwrap();
7fad3a1d3Sopenharmony_ci        }
8fad3a1d3Sopenharmony_ci    }
9fad3a1d3Sopenharmony_ci}
10fad3a1d3Sopenharmony_ci
11fad3a1d3Sopenharmony_cishould_parse!(generic_associated_type, {
12fad3a1d3Sopenharmony_ci    impl Foo {
13fad3a1d3Sopenharmony_ci        type Item = &'a i32;
14fad3a1d3Sopenharmony_ci        fn foo<'a>(&'a self) -> Self::Item<'a> {}
15fad3a1d3Sopenharmony_ci    }
16fad3a1d3Sopenharmony_ci});
17fad3a1d3Sopenharmony_ci
18fad3a1d3Sopenharmony_ci#[rustfmt::skip]
19fad3a1d3Sopenharmony_cishould_parse!(const_generics_use, {
20fad3a1d3Sopenharmony_ci    type X = Foo<5>;
21fad3a1d3Sopenharmony_ci    type Y = Foo<"foo">;
22fad3a1d3Sopenharmony_ci    type Z = Foo<X>;
23fad3a1d3Sopenharmony_ci    type W = Foo<{ X + 10 }>;
24fad3a1d3Sopenharmony_ci});
25fad3a1d3Sopenharmony_ci
26fad3a1d3Sopenharmony_cishould_parse!(trailing_plus_type, {
27fad3a1d3Sopenharmony_ci    type A = Box<Foo>;
28fad3a1d3Sopenharmony_ci    type A = Box<Foo + 'a>;
29fad3a1d3Sopenharmony_ci    type A = Box<'a + Foo>;
30fad3a1d3Sopenharmony_ci});
31fad3a1d3Sopenharmony_ci
32fad3a1d3Sopenharmony_cishould_parse!(generic_associated_type_where, {
33fad3a1d3Sopenharmony_ci    trait Foo {
34fad3a1d3Sopenharmony_ci        type Item;
35fad3a1d3Sopenharmony_ci        fn foo<T>(&self, t: T) -> Self::Item<T>;
36fad3a1d3Sopenharmony_ci    }
37fad3a1d3Sopenharmony_ci});
38fad3a1d3Sopenharmony_ci
39fad3a1d3Sopenharmony_cishould_parse!(match_with_block_expr, {
40fad3a1d3Sopenharmony_ci    fn main() {
41fad3a1d3Sopenharmony_ci        match false {
42fad3a1d3Sopenharmony_ci            _ => {}.a(),
43fad3a1d3Sopenharmony_ci        }
44fad3a1d3Sopenharmony_ci    }
45fad3a1d3Sopenharmony_ci});
46