mozilla/rust — pull request #9740 by alexcrichton (2013-10-06 04:37:19+00:00)
Title: Implement a concat!() format extension

This extension can be used to concatenate string literals at compile time. C has
this useful ability when placing string literals lexically next to one another,
but this needs to be handled at the syntax extension level to recursively expand
macros.

The major use case for this is something like:

macro_rules! mylog( ($fmt:expr $($arg:tt)*) => {
error2!(concat!(file!(), ":", line!(), " - ", $fmt) $($arg)*);
})

Where the mylog macro will automatically prepend the filename/line number to the
beginning of every log message.