What does the following call look like when using syntax.ast:
::method_defined_on_mytrait()
I'm writing a compiler plugin, but I just can't quite nail outputing the above code. I think I need a QSelf with position 1 as the to_string of that then shows the '> as <', but then the function 'call_on_mytrait' is interpreted as an associated type. When I set position:0 on the QSelf and don't include the final PathSegment then the '> as <' isn't produced.
TyKind::Path(
Some(QSelf{ty:P(impl_type), position:1}),
Path{
span,
segments:vec![trait_path,
PathSegment { span, parameters: None, identifier: Ident::from_str("call_on_mytrait") } ] })
Just not quite there. Alternatively is there a quote! macro for compiler plugins - I got a sniff that such a thing might once have existed on google but I couldn't seem to import it?
(I'm doing a compiler plugin as it is my understanding that proc macros can only be used for custom derive at this moment - in my case I need to add a function to an existing trait).