diff options
| author | varkor <github@varkor.com> | 2019-04-25 21:54:09 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-04-25 21:54:09 +0100 |
| commit | 8c3068784c91a2be86b5ea0e5512290cb0e12481 (patch) | |
| tree | 5e9967b1846411861abbded4d17d3fa048ac6350 /src/tools | |
| parent | b759c2d714d4087fb7465fe880675661d5428117 (diff) | |
| download | rust-8c3068784c91a2be86b5ea0e5512290cb0e12481.tar.gz rust-8c3068784c91a2be86b5ea0e5512290cb0e12481.zip | |
Fix false position on style.rs itself
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/tidy/src/style.rs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index 3bb2643f9c3..599b6c676fb 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -212,14 +212,17 @@ pub fn check(path: &Path, bad: &mut bool) { 1 => {} n => tidy_error!(bad, "{}: too many trailing newlines ({})", file.display(), n), }; - if !skip_file_length && lines > LINES { - tidy_error!( - bad, - "{}: too many lines ({}) (add `// ignore-tidy-filelength` to the file to \ - suppress this error)", - file.display(), - lines - ); + if lines > LINES { + let mut err = |_| { + tidy_error!( + bad, + "{}: too many lines ({}) (add `// \ + ignore-tidy-filelength` to the file to suppress this error)", + file.display(), + lines + ); + }; + suppressible_tidy_err!(err, skip_file_length, ""); } if let Directive::Ignore(false) = skip_cr { |
