Skip to content

Commit

Permalink
Auto merge of rust-lang#5930 - ebroto:dev_newlint_fix_lt, r=matthiaskrgr
Browse files Browse the repository at this point in the history
Fix cargo dev new_lint for late lint passes

Since rust-lang/rust-clippy@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 rust-lang#5394

changelog: none
  • Loading branch information
bors committed Aug 23, 2020
2 parents dd07860 + 6dd65b8 commit 2d86cc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion clippy_dev/src/new_lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`!");
},
Expand Down

0 comments on commit 2d86cc5

Please sign in to comment.