-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an AST
Description
The first time it works just fine, but it seems there's some global state somewhere that's messing with the parser. Here's the code: http://is.gd/K0dYsK
The main looks like:
fn main() {
println!("Start");
let src = "fn main() { println!(\"Awesome\"); }".to_string();
let out = Path::new("/tmp/awesome".to_string());
compile(src.clone(), out.clone(), None);
println!("[[first worked]]");
//this should work too, but it seems there's some state being held on to somewere, in the parser?
compile(src.clone(), out.clone(), None);
println!("[[second worked]]")
}
And the error is:
<anon>:1:1: 1:3 error: expected item, found `fn`
<anon>:1 fn main() { println!("Awesome"); }
^~
task '<main>' panicked at 'Box<Any>', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:86
playpen: application terminated with error code 101
Metadata
Metadata
Assignees
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an AST