Recent changes (I guess #23085) make interpolated items unexpected when quoting items. The error is:expected one of const, extern, fn, pub, type, unsafe, or }, found an interpolated item``. The full failing code is available ptal/oak@20ddd3d and a snippet is below:
pub struct PegCompiler<'cx>
{
cx: &'cx ExtCtxt<'cx>,
top_level_items: Vec<rust::P<rust::Item>>
}
impl<'cx> PegCompiler<'cx>
{
fn compile_peg(&mut self) {
let items = &self.top_level_items;
parser.push(quote_item!(self.cx,
impl Parser
{
pub fn new() -> Parser
{
Parser
}
$items // <== Remove this, and the error dissapears.
}).unwrap());
}
}
On rustc 1.1.0-dev (441b3f0c2 2015-04-28) (built 2015-04-28)
Recent changes (I guess #23085) make interpolated items unexpected when quoting items. The error is:
expected one ofconst,extern,fn,pub,type,unsafe, or}, foundan interpolated item``. The full failing code is available ptal/oak@20ddd3d and a snippet is below:On
rustc 1.1.0-dev (441b3f0c2 2015-04-28) (built 2015-04-28)