Skip to content

Commit 498db80

Browse files
committed
don't hide lifetimes for LateContext
1 parent 1d33469 commit 498db80

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clippy_dev/src/new_lint.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
358358

359359
let mod_file_path = ty_dir.join("mod.rs");
360360
let context_import = setup_mod_file(&mod_file_path, lint)?;
361+
let pass_lifetimes = match context_import {
362+
"LateContext" => "<'_>",
363+
_ => "",
364+
};
361365

362366
let name_upper = lint.name.to_uppercase();
363367
let mut lint_file_contents = String::new();
@@ -372,7 +376,7 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
372376
use super::{name_upper};
373377
374378
// TODO: Adjust the parameters as necessary
375-
pub(super) fn check(cx: &{context_import}, msrv: &Msrv) {{
379+
pub(super) fn check(cx: &{context_import}{pass_lifetimes}, msrv: &Msrv) {{
376380
if !msrv.meets(todo!("Add a new entry in `clippy_utils/src/msrvs`")) {{
377381
return;
378382
}}
@@ -389,7 +393,7 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
389393
use super::{name_upper};
390394
391395
// TODO: Adjust the parameters as necessary
392-
pub(super) fn check(cx: &{context_import}) {{
396+
pub(super) fn check(cx: &{context_import}{pass_lifetimes}) {{
393397
todo!();
394398
}}
395399
"#

0 commit comments

Comments
 (0)