5 ms·
> (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
by mattmcal 4d 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.
- tyushk 4d agoDo 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.
- Sharlin 4d agoPedantically, 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).