Skip to content

Commit 2d86cc5

Browse files
committed
Auto merge of #5930 - ebroto:dev_newlint_fix_lt, r=matthiaskrgr
Fix cargo dev new_lint for late lint passes Since 30c046e, `LateLintPass` has only one lifetime parameter. I'm not sure how to easily test this, I think adding this kind of tests would be probably part of #5394 changelog: none
2 parents dd07860 + 6dd65b8 commit 2d86cc5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/clippy.yml

+7
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ jobs:
9292
env:
9393
OS: ${{ runner.os }}
9494

95+
- name: Test cargo dev new lint
96+
run: |
97+
cargo dev new_lint --name new_early_pass --pass early
98+
cargo dev new_lint --name new_late_pass --pass late
99+
cargo check
100+
git reset --hard HEAD
101+
95102
# Cleanup
96103
- name: Run cargo-cache --autoclean
97104
run: |

clippy_dev/src/new_lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn create(pass: Option<&str>, lint_name: Option<&str>, category: Option<&str
4747
fn create_lint(lint: &LintData) -> io::Result<()> {
4848
let (pass_type, pass_lifetimes, pass_import, context_import) = match lint.pass {
4949
"early" => ("EarlyLintPass", "", "use rustc_ast::ast::*;", "EarlyContext"),
50-
"late" => ("LateLintPass", "<'_, '_>", "use rustc_hir::*;", "LateContext"),
50+
"late" => ("LateLintPass", "<'_>", "use rustc_hir::*;", "LateContext"),
5151
_ => {
5252
unreachable!("`pass_type` should only ever be `early` or `late`!");
5353
},

0 commit comments

Comments
 (0)