]> git.lizzy.rs Git - rust.git/blob - tests/ui/no-patterns-in-args-macro.rs
Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum
[rust.git] / tests / ui / no-patterns-in-args-macro.rs
1 macro_rules! m {
2     ($pat: pat) => {
3         trait Tr {
4             fn trait_method($pat: u8);
5         }
6
7         type A = fn($pat: u8);
8
9         extern "C" {
10             fn foreign_fn($pat: u8);
11         }
12     };
13 }
14
15 mod good_pat {
16     m!(good_pat); // OK
17 }
18
19 mod bad_pat {
20     m!((bad, pat));
21     //~^ ERROR patterns aren't allowed in function pointer types
22     //~| ERROR patterns aren't allowed in foreign function declarations
23     //~| ERROR patterns aren't allowed in functions without bodies
24 }
25
26 fn main() {}