syntax: Don't copy source string

This commit is contained in:
Brian Anderson 2012-06-09 01:01:14 -07:00
parent 21087bf1a5
commit 794f664dd9

View File

@ -148,8 +148,7 @@ fn new_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, +path: str,
result::ok(_) { /* Continue. */ }
result::err(e) { sess.span_diagnostic.handler().fatal(e); }
}
// FIXME: This copy is unfortunate (#2319).
let src = @copy result::unwrap(res);
let src = @result::unwrap(res);
let filemap = codemap::new_filemap(path, src, sess.chpos, sess.byte_pos);
sess.cm.files.push(filemap);
let itr = @interner::mk::<@str>({|x|str::hash(*x)}, {|x,y|str::eq(*x, *y)});