Closed U007D closed 6 years ago
Hi @U007D, thanks for the compliment and sorry for taking so long to get round to this. This library makes heavy use of nightly-only, compiler-internal APIs so it tends to break often and badly. I'll rewrite it in the next couple of days to use quasi-quoting instead (something I've been meaning to do for a while), and that should make it a fair bit more stable. In the mean time the only option is to use an older version of nightly (from whenever I published the latest version).
This is now fixed, 0.3.15 is published to crates.io. Hopefully it should be a lot more stable from now on.
I read through the diff--that was quite a bit of work--thank you for jumping on this.
Can you point me to any reading on quasi-quoting? It's not something I've run into before, and my google searches didn't appear to turn up much useful background.
I mean using #[feature(quote)]
and the quote_*!
macros. I don't know if they're documented anywhere but you can look in the compiler source code to see how to use them. They're macros which allow you to generate an AST from Rust code rather than writing out an AST manually. eg:
quote_item!(enum Foo { ... })
Rather than:
Item {
ident: Ident::from_string("Foo"),
attrs: Vec::new(),
id: DUMMY_NODE_ID,
node: ItemKind::Enum(
EnumDef {
variants: ...
},
Generics::default(),
),
vis: Visibility::Public,
span: DUMMY_SP,
}
Hi, @canndrew. First of all, let me say 'thank you' for
error_def
--it is a very nice library. IMHO, it removes more boilerplate from the error-handling process than any of the others.I'm getting errors building it, though, whether I pull from crates.io or from github directly. Any ideas what might be wrong?