Skip to content

don't hide lifetimes for LateContext #11169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions clippy_dev/src/new_lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R

let mod_file_path = ty_dir.join("mod.rs");
let context_import = setup_mod_file(&mod_file_path, lint)?;
let pass_lifetimes = match context_import {
"LateContext" => "<'_>",
_ => "",
};

let name_upper = lint.name.to_uppercase();
let mut lint_file_contents = String::new();
Expand All @@ -372,7 +376,7 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
use super::{name_upper};

// TODO: Adjust the parameters as necessary
pub(super) fn check(cx: &{context_import}, msrv: &Msrv) {{
pub(super) fn check(cx: &{context_import}{pass_lifetimes}, msrv: &Msrv) {{
if !msrv.meets(todo!("Add a new entry in `clippy_utils/src/msrvs`")) {{
return;
}}
Expand All @@ -389,7 +393,7 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
use super::{name_upper};

// TODO: Adjust the parameters as necessary
pub(super) fn check(cx: &{context_import}) {{
pub(super) fn check(cx: &{context_import}{pass_lifetimes}) {{
todo!();
}}
"#
Expand Down