Skip to content

Commit f47a1e2

Browse files
committed
Auto merge of rust-lang#101577 - Dylan-DPC:rollup-l9xw7i7, r=Dylan-DPC
Rollup of 7 pull requests Successful merges: - rust-lang#98933 (Opaque types' generic params do not imply anything about their hidden type's lifetimes) - rust-lang#101041 (translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2) - rust-lang#101424 (Adjust and slightly generalize operator error suggestion) - rust-lang#101496 (Allow lower_lifetime_binder receive a closure) - rust-lang#101501 (Allow lint passes to be bound by `TyCtxt`) - rust-lang#101515 (Recover from typo where == is used in place of =) - rust-lang#101545 (Remove unnecessary `PartialOrd` and `Ord`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 30a5815 + 9faa588 commit f47a1e2

File tree

2 files changed

+211
-209
lines changed

2 files changed

+211
-209
lines changed

clippy_dev/src/new_lint.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,17 @@ fn add_lint(lint: &LintData<'_>, enable_msrv: bool) -> io::Result<()> {
120120

121121
let new_lint = if enable_msrv {
122122
format!(
123-
"store.register_{lint_pass}_pass(move || Box::new({module_name}::{camel_name}::new(msrv)));\n ",
123+
"store.register_{lint_pass}_pass(move |{ctor_arg}| Box::new({module_name}::{camel_name}::new(msrv)));\n ",
124124
lint_pass = lint.pass,
125+
ctor_arg = if lint.pass == "late" { "_" } else { "" },
125126
module_name = lint.name,
126127
camel_name = to_camel_case(lint.name),
127128
)
128129
} else {
129130
format!(
130-
"store.register_{lint_pass}_pass(|| Box::new({module_name}::{camel_name}));\n ",
131+
"store.register_{lint_pass}_pass(|{ctor_arg}| Box::new({module_name}::{camel_name}));\n ",
131132
lint_pass = lint.pass,
133+
ctor_arg = if lint.pass == "late" { "_" } else { "" },
132134
module_name = lint.name,
133135
camel_name = to_camel_case(lint.name),
134136
)

0 commit comments

Comments
 (0)