2023-07-31 14:55:47 +00:00
|
|
|
error: expected `{`, found identifier `foo`
|
2020-02-24 10:04:13 +00:00
|
|
|
--> $DIR/issue-39848.rs:3:21
|
2018-07-15 21:11:54 +00:00
|
|
|
|
|
|
|
|
LL | if $tgt.has_$field() {}
|
2022-05-28 04:58:48 +00:00
|
|
|
| ^^^^^^ expected `{`
|
2018-07-15 21:11:54 +00:00
|
|
|
...
|
|
|
|
LL | get_opt!(bar, foo);
|
2021-10-14 18:28:28 +00:00
|
|
|
| ------------------ in this macro invocation
|
2020-02-24 10:04:13 +00:00
|
|
|
|
|
2022-05-28 04:58:48 +00:00
|
|
|
note: the `if` expression is missing a block after this condition
|
|
|
|
--> $DIR/issue-39848.rs:3:12
|
|
|
|
|
|
|
|
|
LL | if $tgt.has_$field() {}
|
|
|
|
| ^^^^^^^^^
|
|
|
|
...
|
|
|
|
LL | get_opt!(bar, foo);
|
|
|
|
| ------------------ in this macro invocation
|
2021-02-13 19:52:25 +00:00
|
|
|
= note: this error originates in the macro `get_opt` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2022-01-12 20:43:24 +00:00
|
|
|
help: try placing this code inside a block
|
|
|
|
|
|
|
|
|
LL | if $tgt.has_{ $field() } {}
|
|
|
|
| + +
|
2018-07-15 21:11:54 +00:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2018-07-15 21:11:54 +00:00
|
|
|
|