Fix large_include_file lint being triggered all the time by doc comments (#13672)
Fixes #13670. Bug was that I forgot to add the comparison with the included file content length... changelog: Fix `large_include_file` lint being triggered all the time by doc comments
This commit is contained in:
commit
4f0e46b74d
3 changed files with 7 additions and 1 deletions
|
|
@ -94,6 +94,8 @@ impl LateLintPass<'_> for LargeIncludeFile {
|
|||
// Currently, rustc limits the usage of macro at the top-level of attributes,
|
||||
// so we don't need to recurse into each level.
|
||||
&& let AttrKind::Normal(ref normal) = attr.kind
|
||||
&& let Some(doc) = attr.doc_str()
|
||||
&& doc.as_str().len() as u64 > self.max_file_size
|
||||
&& let AttrArgs::Eq(_, AttrArgsEq::Hir(ref meta)) = normal.item.args
|
||||
&& !attr.span.contains(meta.span)
|
||||
// Since the `include_str` is already expanded at this point, we can only take the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue