Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#![crate_name = "rustc_driver"]
#![crate_type = "lib"]
#![unstable]
extern crate rustc;
#[macro_use]
extern crate syntax;
pub mod driver {
use rustc::middle::ty;
use syntax::ast;
use syntax::ast_map;
pub fn compile_input() {
{
let expanded_crate: ast::Crate = unimplemented!();
let mut forest = ast_map::Forest::new(expanded_crate);
let arenas = ty::CtxtArenas::new();
let ast_map = assign_node_ids_and_map(&mut forest);
let analysis = phase_3_run_analysis_passes(ast_map,
&arenas);
};
}
pub fn assign_node_ids_and_map<'ast>(forest: &'ast mut ast_map::Forest)
-> ast_map::Map<'ast> {
loop { }
}
pub fn phase_3_run_analysis_passes<'tcx>(
ast_map: ast_map::Map<'tcx>,
arenas:
&'tcx ty::CtxtArenas<'tcx>)
-> ty::CrateAnalysis<'tcx> {
loop { }
}
}
% CFG_LLVM_LINKAGE_FILE=/Users/fklock/Dev/Mozilla/rust-drop-lts-chkpt/objdir-dbg/x86_64-apple-darwin/rt/llvmdeps.rs DYLD_LIBRARY_PATH=/Users/fklock/Dev/Mozilla/rust-drop-lts-chkpt/objdir-dbg/x86_64-apple-darwin/stage1/lib:$DYLD_LIBRARY_PATH x86_64-apple-darwin/stage1/bin/rustc --cfg stage1 --cfg debug -C prefer-dynamic --target=x86_64-apple-darwin -D warnings -L "x86_64-apple-darwin/rt" -L "/Users/fklock/Dev/Mozilla/rust-drop-lts-chkpt/objdir-dbg/x86_64-apple-darwin/llvm/Release+Asserts/lib" -L "" -C extra-filename=-4e7c5e5c /tmp/librustc_driver2.loops.rs
/tmp/librustc_driver2.loops.rs:25:57: 25:63 error: `arenas` does not live long enough
/tmp/librustc_driver2.loops.rs:25 &arenas);
^~~~~~
/tmp/librustc_driver2.loops.rs:19:66: 27:10 note: reference must be valid for the block suffix following statement 1 at 19:65...
/tmp/librustc_driver2.loops.rs:19 let mut forest = ast_map::Forest::new(expanded_crate);
/tmp/librustc_driver2.loops.rs:20 let arenas = ty::CtxtArenas::new();
/tmp/librustc_driver2.loops.rs:21 let ast_map = assign_node_ids_and_map(&mut forest);
/tmp/librustc_driver2.loops.rs:22
/tmp/librustc_driver2.loops.rs:23
/tmp/librustc_driver2.loops.rs:24 let analysis = phase_3_run_analysis_passes(ast_map,
...
/tmp/librustc_driver2.loops.rs:20:47: 27:10 note: ...but borrowed value is only valid for the block suffix following statement 2 at 20:46
/tmp/librustc_driver2.loops.rs:20 let arenas = ty::CtxtArenas::new();
/tmp/librustc_driver2.loops.rs:21 let ast_map = assign_node_ids_and_map(&mut forest);
/tmp/librustc_driver2.loops.rs:22
/tmp/librustc_driver2.loops.rs:23
/tmp/librustc_driver2.loops.rs:24 let analysis = phase_3_run_analysis_passes(ast_map,
/tmp/librustc_driver2.loops.rs:25 &arenas);
...
error: aborting due to previous error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.