You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The string literal given is empty. This is incidentally also the representation of an “invalid literal”, as defined by the is_error method in Literal. This was a typo - it was meant to be an empty char only that is invalid (since you can’t have an empty char).
The LiteralExpr that wraps this Literal into an expression is also marked as “invalid” as a result.
In macro expansion, all expressions (among other things) are recursively checked for being invalid - being invalid is a marker to “strip” them. You obviously can’t strip components of operator expressions as they no longer make sense without operands, and that is why this error occurs - the macro expander finds that the LiteralExpr used as the operand for the BorrowExpr is invalid, but knows it can’t strip it, so it gives this error message.
TL;DR: We need to add a condition stating that the “type” of the literal must also be char to be invalid (as well as being empty).
Not really sure what is the meaning of the message for :
FTR, rustc gives :
The text was updated successfully, but these errors were encountered: