From 99ffb5af99e694d5b7f5c99af781688c527c4618 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 15 Sep 2015 11:40:04 +1200 Subject: [PATCH 1/2] Add a test for dodgy spans around `>>` Closes #242 --- tests/target/fn.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/target/fn.rs b/tests/target/fn.rs index bc05efa5351..f48e8eaddc6 100644 --- a/tests/target/fn.rs +++ b/tests/target/fn.rs @@ -75,6 +75,10 @@ impl Foo { } } +fn homura>(_: T) { + +} + fn main() { let _ = function(move || 5); let _ = move || 42; From a29023a191c4b48234a051e5f93220061e3183dc Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 15 Sep 2015 11:42:54 +1200 Subject: [PATCH 2/2] Remove a few unnecessary `rustfmt_skip`s --- src/expr.rs | 3 --- src/lib.rs | 17 +++-------------- src/types.rs | 2 -- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/expr.rs b/src/expr.rs index e738976b5c5..c61e12fcb8b 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -128,9 +128,6 @@ impl Rewrite for ast::Expr { ast::Expr_::ExprAssignOp(ref op, ref lhs, ref rhs) => { rewrite_assignment(context, lhs, rhs, Some(op), width, offset) } - // FIXME #184 Note that this formatting is broken due to a bad span - // from the parser. - // `continue` ast::Expr_::ExprAgain(ref opt_ident) => { let id_str = match *opt_ident { Some(ident) => format!(" {}", ident.node), diff --git a/src/lib.rs b/src/lib.rs index 3f8900d6713..e5017387a25 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -237,8 +237,6 @@ fn fmt_ast(krate: &ast::Crate, codemap: &CodeMap, config: &Config) -> FileMap { // Formatting done on a char by char or line by line basis. // TODO warn on bad license // TODO other stuff for parity with make tidy -// FIXME skipping due to `continue`, #184. -#[rustfmt_skip] fn fmt_lines(file_map: &mut FileMap, config: &Config) -> FormatReport { let mut truncate_todo = Vec::new(); let mut report = FormatReport { file_error_map: HashMap::new() }; @@ -260,10 +258,7 @@ fn fmt_lines(file_map: &mut FileMap, config: &Config) -> FormatReport { // Add warnings for bad todos/ fixmes if let Some(issue) = issue_seeker.inspect(c) { - errors.push(FormattingError { - line: cur_line, - kind: ErrorKind::BadIssue(issue) - }); + errors.push(FormattingError { line: cur_line, kind: ErrorKind::BadIssue(issue) }); } if c == '\n' { @@ -274,10 +269,7 @@ fn fmt_lines(file_map: &mut FileMap, config: &Config) -> FormatReport { } // Check for any line width errors we couldn't correct. if line_len > config.max_width { - errors.push(FormattingError { - line: cur_line, - kind: ErrorKind::LineOverflow - }); + errors.push(FormattingError { line: cur_line, kind: ErrorKind::LineOverflow }); } line_len = 0; cur_line += 1; @@ -302,10 +294,7 @@ fn fmt_lines(file_map: &mut FileMap, config: &Config) -> FormatReport { } for &(l, _, _) in &trims { - errors.push(FormattingError { - line: l, - kind: ErrorKind::TrailingWhitespace - }); + errors.push(FormattingError { line: l, kind: ErrorKind::TrailingWhitespace }); } report.file_error_map.insert(f.to_owned(), errors); diff --git a/src/types.rs b/src/types.rs index e0f3140d4d9..d474eb22b70 100644 --- a/src/types.rs +++ b/src/types.rs @@ -149,8 +149,6 @@ impl<'a> Rewrite for SegmentParam<'a> { // We'd really rather not do this, but there doesn't seem to be an alternative // at this point. // FIXME: fails with spans containing comments with the characters < or : -// FIXME #184 skip due to continue. -#[rustfmt_skip] fn get_path_separator(codemap: &CodeMap, path_start: BytePos, segment_start: BytePos)