fix: emit error when fragment is MethodReceiverExpr
and items is empty
This commit is contained in:
parent
2d17294d18
commit
990b2899ad
3 changed files with 35 additions and 1 deletions
|
@ -722,7 +722,11 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
|
|||
});
|
||||
}
|
||||
};
|
||||
if fragment_kind == AstFragmentKind::Expr && items.is_empty() {
|
||||
if matches!(
|
||||
fragment_kind,
|
||||
AstFragmentKind::Expr | AstFragmentKind::MethodReceiverExpr
|
||||
) && items.is_empty()
|
||||
{
|
||||
self.cx.emit_err(RemoveExprNotSupported { span });
|
||||
fragment_kind.dummy(span)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue