Run rustfmt on src

This commit is contained in:
flip1995 2018-11-27 21:12:13 +01:00
parent 2953ae0702
commit d71c871568
No known key found for this signature in database
GPG key ID: E8E897A5870E41C2
3 changed files with 111 additions and 114 deletions

View file

@ -7,11 +7,9 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// error-pattern:yummy // error-pattern:yummy
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(try_from)] #![feature(try_from)]
#![allow(clippy::missing_docs_in_private_items)] #![allow(clippy::missing_docs_in_private_items)]
@ -33,7 +31,8 @@ fn show_version() {
pub fn main() { pub fn main() {
rustc_driver::init_rustc_env_logger(); rustc_driver::init_rustc_env_logger();
exit(rustc_driver::run(move || { exit(
rustc_driver::run(move || {
use std::env; use std::env;
if std::env::args().any(|a| a == "--version" || a == "-V") { if std::env::args().any(|a| a == "--version" || a == "-V") {
@ -93,15 +92,13 @@ pub fn main() {
if clippy_enabled { if clippy_enabled {
args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]); args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-clippy""#.to_owned()]);
if let Ok(extra_args) = env::var("CLIPPY_ARGS") { if let Ok(extra_args) = env::var("CLIPPY_ARGS") {
args.extend( args.extend(extra_args.split("__CLIPPY_HACKERY__").filter_map(|s| {
extra_args if s.is_empty() {
.split("__CLIPPY_HACKERY__")
.filter_map(|s| if s.is_empty() {
None None
} else { } else {
Some(s.to_string()) Some(s.to_string())
}) }
); }));
} }
} }
@ -154,5 +151,8 @@ pub fn main() {
let args = args; let args = args;
rustc_driver::run_compiler(&args, Box::new(controller), None, None) rustc_driver::run_compiler(&args, Box::new(controller), None, None)
}).try_into().expect("exit code too large")) })
.try_into()
.expect("exit code too large"),
)
} }

View file

@ -7,11 +7,9 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// error-pattern:cargo-clippy // error-pattern:cargo-clippy
#![feature(plugin_registrar)] #![feature(plugin_registrar)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![allow(clippy::missing_docs_in_private_items)] #![allow(clippy::missing_docs_in_private_items)]
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]

View file

@ -7,11 +7,9 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// error-pattern:yummy // error-pattern:yummy
#![feature(box_syntax)] #![feature(box_syntax)]
#![feature(rustc_private)] #![feature(rustc_private)]
#![allow(clippy::missing_docs_in_private_items)] #![allow(clippy::missing_docs_in_private_items)]
use rustc_tools_util::*; use rustc_tools_util::*;
@ -106,7 +104,8 @@ where
.into_os_string() .into_os_string()
}, },
) )
}).map(|p| ("CARGO_TARGET_DIR", p)); })
.map(|p| ("CARGO_TARGET_DIR", p));
let exit_status = std::process::Command::new("cargo") let exit_status = std::process::Command::new("cargo")
.args(&args) .args(&args)