diff --git a/build.rs b/build.rs index 42d9330f75d8..2643946236d6 100644 --- a/build.rs +++ b/build.rs @@ -14,7 +14,6 @@ use std::path::PathBuf; use std::process::Command; - fn main() { let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); diff --git a/src/bin/git-fmt.rs b/src/bin/git-fmt.rs index 9bfeff8420e9..5e7cb458649b 100644 --- a/src/bin/git-fmt.rs +++ b/src/bin/git-fmt.rs @@ -14,7 +14,6 @@ use rustfmt::{run, Input}; use rustfmt::config; - fn prune_files(files: Vec<&str>) -> Vec<&str> { let prefixes: Vec<_> = files .iter() diff --git a/src/bin/rustfmt.rs b/src/bin/rustfmt.rs index 001f2c8e0f70..9bf268878817 100644 --- a/src/bin/rustfmt.rs +++ b/src/bin/rustfmt.rs @@ -10,7 +10,6 @@ #![cfg(not(test))] - extern crate env_logger; extern crate getopts; extern crate rustfmt_nightly as rustfmt; diff --git a/src/comment.rs b/src/comment.rs index 2e3dadd20660..4b16199d8269 100644 --- a/src/comment.rs +++ b/src/comment.rs @@ -824,9 +824,6 @@ fn next(&mut self) -> Option { } } - - - /// Iterator over an alternating sequence of functional and commented parts of /// a string. The first item is always a, possibly zero length, subslice of /// functional text. Line style comments contain their ending newlines. @@ -948,7 +945,6 @@ fn changed_comment_content(orig: &str, new: &str) -> bool { res } - /// Iterator over the 'payload' characters of a comment. /// It skips whitespace, comment start/end marks, and '*' at the beginning of lines. /// The comment must be one comment, ie not more than one start mark (no multiple line comments, @@ -994,7 +990,6 @@ fn next(&mut self) -> Option { } } - fn remove_comment_header(comment: &str) -> &str { if comment.starts_with("///") || comment.starts_with("//!") { &comment[3..] diff --git a/src/config.rs b/src/config.rs index 0c7d5c02c019..4172710a0892 100644 --- a/src/config.rs +++ b/src/config.rs @@ -21,7 +21,6 @@ use lists::{ListTactic, SeparatorPlace, SeparatorTactic}; use Summary; - macro_rules! is_nightly_channel { () => { env::var("CFG_RELEASE_CHANNEL") @@ -88,7 +87,6 @@ pub enum $e { Wide, } - impl Density { pub fn to_list_tactic(self) -> ListTactic { match self { @@ -579,8 +577,6 @@ pub fn get_toml_path(dir: &Path) -> Result, Error> { Ok(None) } - - create_config! { // Fundamental stuff max_width: usize, 100, true, "Maximum width of each line"; diff --git a/src/imports.rs b/src/imports.rs index 24ca36851a10..f38e41eca894 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -13,7 +13,6 @@ use syntax::ast; use syntax::codemap::{BytePos, Span}; - use spanned::Spanned; use codemap::SpanUtils; use comment::combine_strs_with_missing_comments; diff --git a/src/items.rs b/src/items.rs index ce0439b127b3..2fc340573557 100644 --- a/src/items.rs +++ b/src/items.rs @@ -285,7 +285,6 @@ pub fn format_foreign_mod(&mut self, fm: &ast::ForeignMod, span: Span) { self.format_item(item); } - fn format_foreign_item(&mut self, item: &ast::ForeignItem) { let rewrite = item.rewrite(&self.get_context(), self.shape()); self.push_rewrite(item.span(), rewrite); diff --git a/src/modules.rs b/src/modules.rs index d136f2709914..30deafd3f9e9 100644 --- a/src/modules.rs +++ b/src/modules.rs @@ -18,7 +18,6 @@ use utils::contains_skip; - /// List all the files containing modules of a crate. /// If a file is used twice in a crate, it appears only once. pub fn list_files<'a>( diff --git a/tests/target/control-brace-style-always-next-line.rs b/tests/target/control-brace-style-always-next-line.rs index 5b368fd08dbd..054a3075ca0c 100644 --- a/tests/target/control-brace-style-always-next-line.rs +++ b/tests/target/control-brace-style-always-next-line.rs @@ -7,28 +7,24 @@ fn main() { (); } - 'label: loop // loop comment { (); } - cond = true; while cond { (); } - 'while_label: while cond { // while comment (); } - for obj in iter { for sub_obj in obj diff --git a/tests/target/control-brace-style-always-same-line.rs b/tests/target/control-brace-style-always-same-line.rs index 46b74b95d825..ae6bf4a56821 100644 --- a/tests/target/control-brace-style-always-same-line.rs +++ b/tests/target/control-brace-style-always-same-line.rs @@ -6,26 +6,22 @@ fn main() { (); } - 'label: loop // loop comment { (); } - cond = true; while cond { (); } - 'while_label: while cond { // while comment (); } - for obj in iter { for sub_obj in obj { 'nested_while_label: while cond { diff --git a/tests/target/else-if-brace-style-always-next-line.rs b/tests/target/else-if-brace-style-always-next-line.rs index c180ff697fcb..31e12cfa0d02 100644 --- a/tests/target/else-if-brace-style-always-next-line.rs +++ b/tests/target/else-if-brace-style-always-next-line.rs @@ -14,10 +14,8 @@ fn main() { (); } - let a = if 0 > 1 { unreachable!() } else { 0x0 }; - if true { (); diff --git a/tests/target/else-if-brace-style-always-same-line.rs b/tests/target/else-if-brace-style-always-same-line.rs index 4c6153d5f1f5..5e5ab21a0d88 100644 --- a/tests/target/else-if-brace-style-always-same-line.rs +++ b/tests/target/else-if-brace-style-always-same-line.rs @@ -13,10 +13,8 @@ fn main() { (); } - let a = if 0 > 1 { unreachable!() } else { 0x0 }; - if true { (); } else if false { diff --git a/tests/target/else-if-brace-style-closing-next-line.rs b/tests/target/else-if-brace-style-closing-next-line.rs index 04ee82bb8284..c99807dc06db 100644 --- a/tests/target/else-if-brace-style-closing-next-line.rs +++ b/tests/target/else-if-brace-style-closing-next-line.rs @@ -13,10 +13,8 @@ fn main() { (); } - let a = if 0 > 1 { unreachable!() } else { 0x0 }; - if true { (); } diff --git a/tests/target/empty-tuple-no-conversion-to-unit-struct.rs b/tests/target/empty-tuple-no-conversion-to-unit-struct.rs index 778937b0d56c..0b9a15e8a926 100644 --- a/tests/target/empty-tuple-no-conversion-to-unit-struct.rs +++ b/tests/target/empty-tuple-no-conversion-to-unit-struct.rs @@ -3,7 +3,6 @@ enum TestEnum { Arm2, } - fn foo() { let test = TestEnum::Arm1; match test { diff --git a/tests/target/enum.rs b/tests/target/enum.rs index 78b0fd1b69d0..779c8b168a3a 100644 --- a/tests/target/enum.rs +++ b/tests/target/enum.rs @@ -95,7 +95,6 @@ pub enum GenericEnum Right { list: I, root: T }, // Post Comment } - enum EmtpyWithComment { // Some comment } diff --git a/tests/target/fn-simple.rs b/tests/target/fn-simple.rs index 3b5e884d4a4d..4e6e64938355 100644 --- a/tests/target/fn-simple.rs +++ b/tests/target/fn-simple.rs @@ -18,7 +18,6 @@ fn op( "cool" } - fn weird_comment( // /*/ double level */ comment x: Hello, // /*/* triple, even */*/ diff --git a/tests/target/fn.rs b/tests/target/fn.rs index 8b581e835394..b78a8b5b21ed 100644 --- a/tests/target/fn.rs +++ b/tests/target/fn.rs @@ -24,7 +24,6 @@ fn foo( } - fn foo( a: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, b: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB, diff --git a/tests/target/impls.rs b/tests/target/impls.rs index e0070adcad4d..a743d7f3067d 100644 --- a/tests/target/impls.rs +++ b/tests/target/impls.rs @@ -78,7 +78,6 @@ fn foo() {} } } - mod b { mod a { impl Foo { diff --git a/tests/target/multiple.rs b/tests/target/multiple.rs index 6e61c82e5f61..b766eb72f68c 100644 --- a/tests/target/multiple.rs +++ b/tests/target/multiple.rs @@ -129,7 +129,6 @@ fn main() { println!("{}", i); } - while true { hello(); } diff --git a/tests/target/type_alias.rs b/tests/target/type_alias.rs index 5aef092934e1..8833be9e1a0f 100644 --- a/tests/target/type_alias.rs +++ b/tests/target/type_alias.rs @@ -52,7 +52,6 @@ T, > = (); - pub type WithWhereClause where T: Clone,