diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index aac5d296f17b5..fe1d190b4ec1a 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1,4 +1,3 @@ -// ignore-tidy-filelength use crate::def::{CtorKind, DefKind, Res}; use crate::def_id::{DefId, CRATE_DEF_ID}; crate use crate::hir_id::{HirId, ItemLocalId}; diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index c590cd00bd545..f341ca686593c 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -1,5 +1,3 @@ -// ignore-tidy-filelength - //! Lints in the Rust compiler. //! //! This contains lints which can feasibly be implemented as their own diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 9b1ee53df23bd..8376734166bb8 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -1,5 +1,3 @@ -// ignore-tidy-filelength - //! Some lints that are built in to the compiler. //! //! These are the built-in lints that are emitted direct in the main diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index 2e4395cfca8c1..423f3faf21fff 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -1,4 +1,3 @@ -// ignore-tidy-filelength use crate::ich::StableHashingContext; use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags; use crate::mir::{GeneratorLayout, GeneratorSavedLocal}; diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs index 06cb33b9ebf4b..eb94fde21099b 100644 --- a/compiler/rustc_typeck/src/collect.rs +++ b/compiler/rustc_typeck/src/collect.rs @@ -1,4 +1,3 @@ -// ignore-tidy-filelength //! "Collection" is the process of determining the type and other external //! details of each item in Rust. Collection is specifically concerned //! with *inter-procedural* things -- for example, for a function @@ -15,8 +14,6 @@ //! At present, however, we do run collection across all items in the //! crate as a kind of pass. This should eventually be factored away. -// ignore-tidy-filelength - use crate::astconv::{AstConv, SizedByDefault}; use crate::bounds::Bounds; use crate::check::intrinsic::intrinsic_operation_unsafety; diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index 537e42f66de1b..c199b068cbb59 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -1,7 +1,3 @@ -// ignore-tidy-filelength -// This file almost exclusively consists of the definition of `Iterator`. We -// can't split that into multiple files. - use crate::cmp::{self, Ordering}; use crate::ops::{ControlFlow, Try}; diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs index 419bf0e292ae1..d67af9cf6680c 100644 --- a/library/core/src/slice/iter.rs +++ b/library/core/src/slice/iter.rs @@ -1,4 +1,3 @@ -// ignore-tidy-filelength //! Definitions of a bunch of iterators for `[T]`. #[macro_use] // import iterator! and forward_iterator! diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 67eecab99d89a..51227d5411549 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -1,5 +1,3 @@ -// ignore-tidy-filelength - //! Slice management and manipulation. //! //! For more details see [`std::slice`]. diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 933d686521e53..1628e1bceda72 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -1,5 +1,3 @@ -// ignore-tidy-filelength - #[cfg(test)] mod tests; diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index 15ed2f7a0a975..d8d3dc3ddb1e5 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -344,7 +344,10 @@ pub fn check(path: &Path, bad: &mut bool) { } else { trailing_new_lines = 0; } - lines = i; + + if !line.trim().starts_with("//") { + lines += 1; + } } if leading_new_lines { tidy_error!(bad, "{}: leading newline", file.display());