mozilla/rust — Issue #1926: assertion failures in quasi-quoting
Author: nikomatsakis
Created: 2012-03-05 19:15:09+00:00
State: open

The following test fails with assertion failures about the "gather" ordering not being properly setup:

```
use rustc;
import rustc::driver::diagnostic;
import rustc::syntax::ast;
import rustc::syntax::codemap;
import rustc::syntax::print::pprust;

fn new_parse_sess() -> parser::parse_sess {
let cm = codemap::new_codemap();
let handler = diagnostic::mk_handler(option::none);
let sess = @{
cm: cm,
mutable next_id: 1,
span_diagnostic: diagnostic::mk_span_handler(handler, cm),
mutable chpos: 0u,
mutable byte_pos: 0u
};
ret sess;
}

iface fake_ext_ctxt {
fn session() -> fake_session;
}

type fake_options = {cfg: ast::crate_cfg};

type fake_session = {opts: @fake_options,
parse_sess: parser::parse_sess};

impl of fake_ext_ctxt for fake_session {
fn session() -> fake_session {self}
}

fn mk_ctxt() -> fake_ext_ctxt {
let opts : fake_options = {cfg: []};
{opts: @opts, parse_sess: new_parse_sess()} as fake_ext_ctxt
}

fn main() {
let ext_cx = mk_ctxt();
let s = #ast(expr){__s};
let e = #ast(expr){__e};
let f = #ast(expr){$(s).foo {|__e| $(e)}}; // THIS IS THE PROBLEM EXPR
pprust::print_expr(f);
}
```