]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/macro-in-expression-context.rs
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr
[rust.git] / tests / ui / macros / macro-in-expression-context.rs
1 // run-rustfix
2
3 macro_rules! foo {
4     () => {
5         assert_eq!("A", "A");
6         //~^ WARN trailing semicolon in macro
7         //~| WARN this was previously
8         //~| NOTE macro invocations at the end of a block
9         //~| NOTE to ignore the value produced by the macro
10         //~| NOTE for more information
11         //~| NOTE `#[warn(semicolon_in_expressions_from_macros)]` on by default
12         assert_eq!("B", "B");
13     }
14     //~^^ ERROR macro expansion ignores token `assert_eq` and any following
15     //~| NOTE the usage of `foo!` is likely invalid in expression context
16 }
17
18 fn main() {
19     foo!()
20     //~^ NOTE caused by the macro expansion here
21     //~| NOTE in this expansion
22     //~| NOTE in this expansion
23     //~| NOTE in this expansion
24     //~| NOTE in this expansion
25     //~| NOTE in this expansion
26     //~| NOTE in this expansion
27 }