Hacker News new | ask | show | jobs
by mattmcal 82 days ago
> (Note: Rust also uses exclamation marks to indicate calls to macros. The way the syntax is constructed, a place where it is valid to use the never type is not a valid place to put a macro invocation and vice versa.

Yeah this statement is incorrect as well. Weird to have these minor technical inaccuracies in a relatively detailed article.

1 comments

Do you have an example? I'm struggling to think of such a case where ! is ambiguous between a end of macro call and the Never type.
Pedantically, the phrasing in the article is incorrect because macro invocations are permissible in type positions. But as you said, the macro invocation syntax is nevertheless not ambiguous with !-as-type (or !-as-operator for that matter).