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
It is a bit counter-intuitive that I can call an inherent method inside a macro expansion, but I cannot do so on a type that was deduced by a macro expansion. (rustc 1.32.0)
Compiling playground v0.0.1 (/playground)
error: expected one of `.`, `;`, `?`, or an operator, found `::`
--> src/main.rs:20:30
|
20 | let _t2 = choose_type!(a)::create();
| ^^ expected one of `.`, `;`, `?`, or an operator here
...
How is the create_type macro more hygienic than the choose_type one?
The text was updated successfully, but these errors were encountered:
Wow. Thanks for the prompt answers. So basically I can use the more verbose <Type>::method() format anywhere and in some cases even the Type::method() works, but that is more like an exception than the rule 😉
It is a bit counter-intuitive that I can call an inherent method inside a macro expansion, but I cannot do so on a type that was deduced by a macro expansion. (rustc 1.32.0)
(Playground)
Errors:
How is the
create_type
macro more hygienic than thechoose_type
one?The text was updated successfully, but these errors were encountered: