1 error: expected `{`, found `foo`
2 --> $DIR/issue-39848.rs:3:21
4 LL | if $tgt.has_$field() {}
7 LL | get_opt!(bar, foo);
8 | ------------------ in this macro invocation
10 note: the `if` expression is missing a block after this condition
11 --> $DIR/issue-39848.rs:3:12
13 LL | if $tgt.has_$field() {}
16 LL | get_opt!(bar, foo);
17 | ------------------ in this macro invocation
18 = note: this error originates in the macro `get_opt` (in Nightly builds, run with -Z macro-backtrace for more info)
19 help: try placing this code inside a block
21 LL | if $tgt.has_{ $field() } {}
24 error: aborting due to previous error