]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs
Rollup merge of #86263 - fee1-dead:rustdoc-layout-variants, r=camelid
[rust.git] / src / test / ui / closures / 2229_closure_analysis / migrations / closure-body-macro-fragment.rs
1 // run-rustfix
2 // edition:2018
3 // check-pass
4 #![warn(rust_2021_compatibility)]
5
6 macro_rules! m {
7     (@ $body:expr) => {{
8         let f = || $body;
9         //~^ WARNING: drop order
10         f();
11     }};
12     ($body:block) => {{
13         m!(@ $body);
14     }};
15 }
16
17 fn main() {
18     let a = (1.to_string(), 2.to_string());
19     m!({
20         //~^ HELP: add a dummy
21         let x = a.0;
22         println!("{}", x);
23     });
24 }