Skip to content

Commit 2b6cd29

Browse files
committed
Cleanup: rename EarlyContext/LateContext parameters
1 parent 2903b66 commit 2b6cd29

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

clippy_lints/src/significant_drop_tightening.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl<'tcx> Visitor<'tcx> for StmtsChecker<'_, '_, '_, '_, 'tcx> {
319319
}
320320
},
321321
hir::StmtKind::Semi(semi_expr) => {
322-
if has_drop(semi_expr, apa.first_bind_ident, self.cx) {
322+
if has_drop(self.cx, semi_expr, apa.first_bind_ident) {
323323
apa.has_expensive_expr_after_last_attr = false;
324324
apa.last_stmt_span = DUMMY_SP;
325325
return;
@@ -416,11 +416,11 @@ fn dummy_stmt_expr<'any>(expr: &'any hir::Expr<'any>) -> hir::Stmt<'any> {
416416
}
417417
}
418418

419-
fn has_drop(expr: &hir::Expr<'_>, first_bind_ident: Option<Ident>, lcx: &LateContext<'_>) -> bool {
419+
fn has_drop(cx: &LateContext<'_>, expr: &hir::Expr<'_>, first_bind_ident: Option<Ident>) -> bool {
420420
if let hir::ExprKind::Call(fun, [first_arg]) = expr.kind
421421
&& let hir::ExprKind::Path(hir::QPath::Resolved(_, fun_path)) = &fun.kind
422422
&& let Res::Def(DefKind::Fn, did) = fun_path.res
423-
&& lcx.tcx.is_diagnostic_item(sym::mem_drop, did)
423+
&& cx.tcx.is_diagnostic_item(sym::mem_drop, did)
424424
{
425425
let has_ident = |local_expr: &hir::Expr<'_>| {
426426
if let hir::ExprKind::Path(hir::QPath::Resolved(_, arg_path)) = &local_expr.kind

clippy_lints/src/single_char_lifetime_names.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ declare_clippy_lint! {
4040
declare_lint_pass!(SingleCharLifetimeNames => [SINGLE_CHAR_LIFETIME_NAMES]);
4141

4242
impl EarlyLintPass for SingleCharLifetimeNames {
43-
fn check_generic_param(&mut self, ctx: &EarlyContext<'_>, param: &GenericParam) {
44-
if param.ident.span.in_external_macro(ctx.sess().source_map()) {
43+
fn check_generic_param(&mut self, cx: &EarlyContext<'_>, param: &GenericParam) {
44+
if param.ident.span.in_external_macro(cx.sess().source_map()) {
4545
return;
4646
}
4747

@@ -51,7 +51,7 @@ impl EarlyLintPass for SingleCharLifetimeNames {
5151
{
5252
#[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")]
5353
span_lint_and_then(
54-
ctx,
54+
cx,
5555
SINGLE_CHAR_LIFETIME_NAMES,
5656
param.ident.span,
5757
"single-character lifetime names are likely uninformative",

clippy_lints_internal/src/produce_ice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ declare_tool_lint! {
2525
declare_lint_pass!(ProduceIce => [PRODUCE_ICE]);
2626

2727
impl EarlyLintPass for ProduceIce {
28-
fn check_fn(&mut self, ctx: &EarlyContext<'_>, fn_kind: FnKind<'_>, span: Span, _: NodeId) {
28+
fn check_fn(&mut self, cx: &EarlyContext<'_>, fn_kind: FnKind<'_>, span: Span, _: NodeId) {
2929
if is_trigger_fn(fn_kind) {
30-
ctx.sess()
30+
cx.sess()
3131
.dcx()
3232
.span_delayed_bug(span, "Would you like some help with that?");
3333
}

0 commit comments

Comments
 (0)