Skip to content

Commit a63f367

Browse files
committed
Add the new line to new_lint + fix dogfood
1 parent 8500ecb commit a63f367

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

clippy_dev/src/new_lint.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
273273
result.push_str(&if enable_msrv {
274274
formatdoc!(
275275
r#"
276+
use crate::declare_clippy_lint;
276277
use clippy_config::msrvs::{{self, Msrv}};
277278
use clippy_config::Conf;
278279
{pass_import}
@@ -284,6 +285,7 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
284285
} else {
285286
formatdoc!(
286287
r#"
288+
use crate::declare_clippy_lint;
287289
{pass_import}
288290
use rustc_lint::{{{context_import}, {pass_type}}};
289291
use rustc_session::declare_lint_pass;

clippy_lints/src/declare_clippy_lint.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ macro_rules! declare_clippy_lint {
1919
report_in_external_macro:true
2020
}
2121

22-
pub(crate) static ${concat($lint_name, _INFO)}: &'static crate::LintInfo = &crate::LintInfo {
22+
pub(crate) static ${concat($lint_name, _INFO)}: &'static $crate::LintInfo = &$crate::LintInfo {
2323
lint: &$lint_name,
2424
category: $lintcategory,
2525
explanation: concat!($($lit,"\n",)*),
@@ -36,7 +36,7 @@ macro_rules! declare_clippy_lint {
3636
) => {
3737
declare_clippy_lint! {@
3838
$(#[doc = $lit])*
39-
pub $lint_name,Allow, crate::LintCategory::Restriction,$desc,
39+
pub $lint_name,Allow, $crate::LintCategory::Restriction,$desc,
4040
declare_clippy_lint!(__version = $version), $version
4141
}
4242
};
@@ -49,7 +49,7 @@ macro_rules! declare_clippy_lint {
4949
) => {
5050
declare_clippy_lint! {@
5151
$(#[doc = $lit])*
52-
pub $lint_name, Warn, crate::LintCategory::Style,$desc,
52+
pub $lint_name, Warn, $crate::LintCategory::Style,$desc,
5353
declare_clippy_lint!(__version = $version), $version
5454

5555
}
@@ -63,7 +63,7 @@ macro_rules! declare_clippy_lint {
6363
) => {
6464
declare_clippy_lint! {@
6565
$(#[doc = $lit])*
66-
pub $lint_name,Deny, crate::LintCategory::Correctness,$desc,
66+
pub $lint_name,Deny, $crate::LintCategory::Correctness,$desc,
6767
declare_clippy_lint!(__version = $version), $version
6868

6969
}
@@ -77,7 +77,7 @@ macro_rules! declare_clippy_lint {
7777
) => {
7878
declare_clippy_lint! {@
7979
$(#[doc = $lit])*
80-
pub $lint_name, Warn, crate::LintCategory::Perf,$desc,
80+
pub $lint_name, Warn, $crate::LintCategory::Perf,$desc,
8181
declare_clippy_lint!(__version = $version), $version
8282
}
8383
};
@@ -90,7 +90,7 @@ macro_rules! declare_clippy_lint {
9090
) => {
9191
declare_clippy_lint! {@
9292
$(#[doc = $lit])*
93-
pub $lint_name, Warn, crate::LintCategory::Complexity,$desc,
93+
pub $lint_name, Warn, $crate::LintCategory::Complexity,$desc,
9494
declare_clippy_lint!(__version = $version), $version
9595
}
9696
};
@@ -103,7 +103,7 @@ macro_rules! declare_clippy_lint {
103103
) => {
104104
declare_clippy_lint! {@
105105
$(#[doc = $lit])*
106-
pub $lint_name, Warn, crate::LintCategory::Suspicious,$desc,
106+
pub $lint_name, Warn, $crate::LintCategory::Suspicious,$desc,
107107
declare_clippy_lint!(__version = $version), $version
108108
}
109109
};
@@ -116,7 +116,7 @@ macro_rules! declare_clippy_lint {
116116
) => {
117117
declare_clippy_lint! {@
118118
$(#[doc = $lit])*
119-
pub $lint_name,Allow, crate::LintCategory::Nursery,$desc,
119+
pub $lint_name,Allow, $crate::LintCategory::Nursery,$desc,
120120
declare_clippy_lint!(__version = $version), $version
121121
}
122122
};
@@ -129,7 +129,7 @@ macro_rules! declare_clippy_lint {
129129
) => {
130130
declare_clippy_lint! {@
131131
$(#[doc = $lit])*
132-
pub $lint_name,Allow, crate::LintCategory::Pedantic,$desc,
132+
pub $lint_name,Allow, $crate::LintCategory::Pedantic,$desc,
133133
declare_clippy_lint!(__version = $version), $version
134134
}
135135
};
@@ -142,7 +142,7 @@ macro_rules! declare_clippy_lint {
142142
) => {
143143
declare_clippy_lint! {@
144144
$(#[doc = $lit])*
145-
pub $lint_name,Allow, crate::LintCategory::Cargo,$desc,
145+
pub $lint_name,Allow, $crate::LintCategory::Cargo,$desc,
146146
declare_clippy_lint!(__version = $version), $version
147147
}
148148
};
@@ -156,7 +156,7 @@ macro_rules! declare_clippy_lint {
156156
) => {
157157
declare_clippy_lint! {@
158158
$(#[doc = $lit])*
159-
pub $lint_name,Allow, crate::LintCategory::Internal,$desc,
159+
pub $lint_name,Allow, $crate::LintCategory::Internal,$desc,
160160
declare_clippy_lint!(__version = $($version)?), "0.0.0"
161161
}
162162
};

tests/versioncheck.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ fn consistent_clippy_crate_versions() {
2424
let clippy_version = read_version("Cargo.toml");
2525

2626
let paths = [
27-
"declare_clippy_lint/Cargo.toml",
2827
"clippy_config/Cargo.toml",
2928
"clippy_lints/Cargo.toml",
3029
"clippy_utils/Cargo.toml",

0 commit comments

Comments
 (0)