[rust-dev] 7 high priority Rust libraries that need to be written

Huon Wilson dbau.pp at gmail.com
Thu Jun 5 02:21:06 PDT 2014

On 05/06/14 19:11, kimhyunkang at gmail.com wrote:
> I was also planning to add sql!() macro almost exactly same as Chris 
> Morgan suggests. However, you can't directly access type-checking part 
> of rustc in #![phase(syntax)] modules, which means you need some dirty 
> hacks to peroperly type-check such macros.

The conventional approach is to expand to something that uses certain 
traits, meaning any external data has to satisfy those traits for the 
macro invocation to work. This technique is used by `println!` and 
`#[deriving]`, for example.

(I don't know if you regard this as a dirty hack or not.)


More information about the Rust-dev mailing list