We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ffe7b3 commit ce661e3Copy full SHA for ce661e3
lints/par_fold/src/rayon_import.rs
@@ -29,6 +29,22 @@ declare_lint_pass!(RayonImport => [RAYON_IMPORT]);
29
30
impl LateLintPass<'_> for RayonImport {
31
fn check_crate(&mut self, cx: &LateContext<'_>) {
32
+ // Skip linting if in build.rs file
33
+ if cx
34
+ .sess()
35
+ .source_map()
36
+ .span_to_filename(cx.tcx.hir().root_module().spans.inner_span)
37
+ .is_real()
38
+ && cx
39
40
41
42
+ .to_string()
43
+ .ends_with("build.rs")
44
+ {
45
+ return;
46
+ }
47
+
48
let mut found_rayon_prelude = false;
49
50
for item_id in cx.tcx.hir().items() {
0 commit comments