Skip to content
This repository has been archived by the owner on Mar 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request #6 from alessandrod/master
Browse files Browse the repository at this point in the history
Fix compilation with rustc 1.25.0-nightly (4e3901d35 2018-01-23)
  • Loading branch information
nrc authored Jan 24, 2018
2 parents e0fa5b0 + de51775 commit 1d6f9a6
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,32 @@ extern crate rustc_trans_utils;
extern crate syntax;

use rustc::middle::cstore::CrateStore;
use rustc::session::Session;
use rustc::session::{Session, early_error};
use rustc::session::config::{self, ErrorOutputType, Input};
use rustc_trans_utils::trans_crate::TransCrate;
use rustc_driver::driver::CompileController;
use rustc_driver::{run_compiler, CompilerCalls, RustcDefaultCalls, Compilation, enable_save_analysis, get_args};
use rustc_driver::{run_compiler, CompilerCalls, RustcDefaultCalls, Compilation, enable_save_analysis};
use syntax::ast;

use std::env;
use std::path::PathBuf;
use std::process;

pub fn run() {
env_logger::init().unwrap();
let result = rustc_driver::run(|| {
let args = env::args_os().enumerate()
.map(|(i, arg)| arg.into_string().unwrap_or_else(|arg| {
early_error(ErrorOutputType::default(),
&format!("Argument {} is not valid Unicode: {:?}", i, arg))
}))
.collect::<Vec<_>>();

let result = rustc_driver::run(|| run_compiler(&get_args(),
&mut ShimCalls,
None,
None));
run_compiler(&args,
&mut ShimCalls,
None,
None)
});
process::exit(result as i32);
}

Expand Down

0 comments on commit 1d6f9a6

Please sign in to comment.