#![feature(slicing_syntax, unsafe_destructor)]
#![feature(rustc_diagnostic_macros)]
#![feature(unboxed_closures)]
+#![feature(associated_types)]
extern crate arena;
extern crate flate;
use rustc::metadata;
use rustc::DIAGNOSTICS;
-use std::any::AnyRefExt;
+use std::cmp::Ordering::Equal;
use std::io;
use std::iter::repeat;
use std::os;
+use std::sync::mpsc::channel;
use std::thread;
use rustc::session::early_error;
_ => early_error("multiple input filenames provided")
};
- let sess = build_session(sopts, input_file_path, descriptions);
+ let mut sess = build_session(sopts, input_file_path, descriptions);
let cfg = config::build_configuration(&sess);
if print_crate_info(&sess, Some(&input), &odir, &ofile) {
return
pretty::parse_pretty(&sess, a.as_slice(), false)
});
let pretty = if pretty.is_none() &&
- sess.debugging_opt(config::UNSTABLE_OPTIONS) {
+ sess.unstable_options() {
matches.opt_str("xpretty").map(|a| {
// extended with unstable pretty-print variants
pretty::parse_pretty(&sess, a.as_slice(), true)
None => {/* continue */ }
}
+ if sess.unstable_options() {
+ sess.opts.show_span = matches.opt_str("show-span");
+ }
+
let r = matches.opt_strs("Z");
if r.contains(&("ls".to_string())) {
match input {
let max_name_len = plugin.iter().chain(builtin.iter())
.map(|&s| s.name.width(true))
.max().unwrap_or(0);
- let padded = |x: &str| {
+ let padded = |&: x: &str| {
let mut s = repeat(" ").take(max_name_len - x.chars().count())
.collect::<String>();
s.push_str(x);
println!(" {} {:7.7} {}", padded("name"), "default", "meaning");
println!(" {} {:7.7} {}", padded("----"), "-------", "-------");
- let print_lints = |lints: Vec<&Lint>| {
+ let print_lints = |&: lints: Vec<&Lint>| {
for lint in lints.into_iter() {
let name = lint.name_lower().replace("_", "-");
println!(" {} {:7.7} {}",
let max_name_len = plugin_groups.iter().chain(builtin_groups.iter())
.map(|&(s, _)| s.width(true))
.max().unwrap_or(0);
- let padded = |x: &str| {
+ let padded = |&: x: &str| {
let mut s = repeat(" ").take(max_name_len - x.chars().count())
.collect::<String>();
s.push_str(x);
println!(" {} {}", padded("name"), "sub-lints");
println!(" {} {}", padded("----"), "---------");
- let print_lint_groups = |lints: Vec<(&'static str, Vec<lint::LintId>)>| {
+ let print_lint_groups = |&: lints: Vec<(&'static str, Vec<lint::LintId>)>| {
for (name, to) in lints.into_iter() {
let name = name.chars().map(|x| x.to_lowercase())
.collect::<String>().replace("_", "-");