#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
-#![feature(int_uint)]
#![feature(libc)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
extern crate rustc_trans;
extern crate rustc_typeck;
extern crate serialize;
-extern crate "rustc_llvm" as llvm;
+extern crate rustc_llvm as llvm;
#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
"https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports";
-pub fn run(args: Vec<String>) -> int {
+pub fn run(args: Vec<String>) -> isize {
monitor(move || run_compiler(&args, &mut RustcDefaultCalls));
0
}
// Extract output directory and file from matches.
fn make_output(matches: &getopts::Matches) -> (Option<PathBuf>, Option<PathBuf>) {
- let odir = matches.opt_str("out-dir").map(|o| PathBuf::new(&o));
- let ofile = matches.opt_str("o").map(|o| PathBuf::new(&o));
+ let odir = matches.opt_str("out-dir").map(|o| PathBuf::from(&o));
+ let ofile = matches.opt_str("o").map(|o| PathBuf::from(&o));
(odir, ofile)
}
io::stdin().read_to_string(&mut src).unwrap();
Some((Input::Str(src), None))
} else {
- Some((Input::File(PathBuf::new(ifile)), Some(PathBuf::new(ifile))))
+ Some((Input::File(PathBuf::from(ifile)), Some(PathBuf::from(ifile))))
}
} else {
None
/// errors of the compiler.
#[allow(deprecated)]
pub fn monitor<F:FnOnce()+Send+'static>(f: F) {
- const STACK_SIZE: uint = 8 * 1024 * 1024; // 8MB
+ const STACK_SIZE: usize = 8 * 1024 * 1024; // 8MB
struct Sink(Arc<Mutex<Vec<u8>>>);
impl Write for Sink {
use syntax::diagnostics::registry::Registry;
let all_errors = Vec::new() +
- rustc::diagnostics::DIAGNOSTICS.as_slice() +
- rustc_typeck::diagnostics::DIAGNOSTICS.as_slice() +
- rustc_resolve::diagnostics::DIAGNOSTICS.as_slice();
+ &rustc::diagnostics::DIAGNOSTICS[..] +
+ &rustc_typeck::diagnostics::DIAGNOSTICS[..] +
+ &rustc_resolve::diagnostics::DIAGNOSTICS[..];
Registry::new(&*all_errors)
}