#![feature(box_syntax)]
#![cfg_attr(unix, feature(libc))]
+#![feature(option_replace)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(slice_sort_by_cached_key)]
use rustc::session::{early_error, early_warn};
use rustc::lint::Lint;
use rustc::lint;
-use rustc::middle::cstore::CrateStore;
use rustc_metadata::locator;
use rustc_metadata::cstore::CStore;
use rustc_metadata::dynamic_lib::DynamicLibrary;
if let Some(err) = input_err {
// Immediately stop compilation if there was an issue reading
// the input (for example if the input stream is not UTF-8).
- sess.err(&format!("{}", err));
+ sess.err(&err.to_string());
return (Err(CompileIncomplete::Stopped), Some(sess));
}
_: &dyn CodegenBackend,
_: &getopts::Matches,
_: &Session,
- _: &dyn CrateStore,
+ _: &CStore,
_: &Input,
_: &Option<PathBuf>,
_: &Option<PathBuf>)
codegen_backend: &dyn CodegenBackend,
matches: &getopts::Matches,
sess: &Session,
- cstore: &dyn CrateStore,
+ cstore: &CStore,
input: &Input,
odir: &Option<PathBuf>,
ofile: &Option<PathBuf>)
impl RustcDefaultCalls {
pub fn list_metadata(sess: &Session,
- cstore: &dyn CrateStore,
+ cstore: &CStore,
matches: &getopts::Matches,
input: &Input)
-> Compilation {
let mut v = Vec::new();
locator::list_file_metadata(&sess.target.target,
path,
- cstore.metadata_loader(),
+ &*cstore.metadata_loader,
&mut v)
.unwrap();
println!("{}", String::from_utf8(v).unwrap());
cfgs.push(if let Some(value) = value {
format!("{}=\"{}\"", name, value)
} else {
- format!("{}", name)
+ name.to_string()
});
}
for option in groups.iter().filter(|x| include_unstable_options || x.is_stable()) {
(option.apply)(&mut options);
}
- let message = format!("Usage: rustc [OPTIONS] INPUT");
+ let message = "Usage: rustc [OPTIONS] INPUT".to_string();
let nightly_help = if nightly_options::is_nightly_build() {
"\n -Z help Print internal options for debugging rustc"
} else {
/// debugging, since some ICEs only happens with non-default compiler flags
/// (and the users don't always report them).
fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
- let mut args = Vec::new();
- for arg in env::args_os() {
- args.push(arg.to_string_lossy().to_string());
- }
+ let args = env::args_os().map(|arg| arg.to_string_lossy().to_string()).collect::<Vec<_>>();
// Avoid printing help because of empty args. This can suggest the compiler
// itself is not the program root (consider RLS).