Fix cargo dev new_lint for late lint passes
This commit is contained in:
parent
dd07860b83
commit
6dd65b8e6a
7
.github/workflows/clippy.yml
vendored
7
.github/workflows/clippy.yml
vendored
@ -92,6 +92,13 @@ jobs:
|
||||
env:
|
||||
OS: ${{ runner.os }}
|
||||
|
||||
- name: Test cargo dev new lint
|
||||
run: |
|
||||
cargo dev new_lint --name new_early_pass --pass early
|
||||
cargo dev new_lint --name new_late_pass --pass late
|
||||
cargo check
|
||||
git reset --hard HEAD
|
||||
|
||||
# Cleanup
|
||||
- name: Run cargo-cache --autoclean
|
||||
run: |
|
||||
|
@ -47,7 +47,7 @@ pub fn create(pass: Option<&str>, lint_name: Option<&str>, category: Option<&str
|
||||
fn create_lint(lint: &LintData) -> io::Result<()> {
|
||||
let (pass_type, pass_lifetimes, pass_import, context_import) = match lint.pass {
|
||||
"early" => ("EarlyLintPass", "", "use rustc_ast::ast::*;", "EarlyContext"),
|
||||
"late" => ("LateLintPass", "<'_, '_>", "use rustc_hir::*;", "LateContext"),
|
||||
"late" => ("LateLintPass", "<'_>", "use rustc_hir::*;", "LateContext"),
|
||||
_ => {
|
||||
unreachable!("`pass_type` should only ever be `early` or `late`!");
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user