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

Fix compilation with rustc 1.25.0-nightly (4e3901d35 2018-01-23) #6

Merged
merged 1 commit into from
Jan 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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