Skip to content

Commit fc2298c

Browse files
committed
Fix clippy uses of QPath::LangItem
1 parent 4f5ba7a commit fc2298c

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

src/tools/clippy/clippy_lints/src/methods/str_splitn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ fn parse_iter_usage(
204204
match e.kind {
205205
ExprKind::Call(
206206
Expr {
207-
kind: ExprKind::Path(QPath::LangItem(LangItem::TryTraitBranch, _)),
207+
kind: ExprKind::Path(QPath::LangItem(LangItem::TryTraitBranch, ..)),
208208
..
209209
},
210210
_,

src/tools/clippy/clippy_lints/src/needless_question_mark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
105105
};
106106
if let ExprKind::Match(inner_expr_with_q, _, MatchSource::TryDesugar) = &arg.kind;
107107
if let ExprKind::Call(called, [inner_expr]) = &inner_expr_with_q.kind;
108-
if let ExprKind::Path(QPath::LangItem(LangItem::TryTraitBranch, _)) = &called.kind;
108+
if let ExprKind::Path(QPath::LangItem(LangItem::TryTraitBranch, ..)) = &called.kind;
109109
if expr.span.ctxt() == inner_expr.span.ctxt();
110110
let expr_ty = cx.typeck_results().expr_ty(expr);
111111
let inner_ty = cx.typeck_results().expr_ty(inner_expr);

src/tools/clippy/clippy_lints/src/strings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ impl<'tcx> LateLintPass<'tcx> for StringLitAsBytes {
260260
if method_names[0] == sym!(as_bytes);
261261

262262
// Check for slicer
263-
if let ExprKind::Struct(QPath::LangItem(LangItem::Range, _), _, _) = right.kind;
263+
if let ExprKind::Struct(QPath::LangItem(LangItem::Range, ..), _, _) = right.kind;
264264

265265
then {
266266
let mut applicability = Applicability::MachineApplicable;

src/tools/clippy/clippy_lints/src/try_err.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'tcx> LateLintPass<'tcx> for TryErr {
6565
if let ExprKind::Match(match_arg, _, MatchSource::TryDesugar) = expr.kind;
6666
if let ExprKind::Call(match_fun, try_args) = match_arg.kind;
6767
if let ExprKind::Path(ref match_fun_path) = match_fun.kind;
68-
if matches!(match_fun_path, QPath::LangItem(LangItem::TryTraitBranch, _));
68+
if matches!(match_fun_path, QPath::LangItem(LangItem::TryTraitBranch, ..));
6969
if let Some(try_arg) = try_args.get(0);
7070
if let ExprKind::Call(err_fun, err_args) = try_arg.kind;
7171
if let Some(err_arg) = err_args.get(0);

src/tools/clippy/clippy_lints/src/unused_io_amount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedIoAmount {
4949
if let hir::ExprKind::Call(func, [ref arg_0, ..]) = res.kind {
5050
if matches!(
5151
func.kind,
52-
hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::TryTraitBranch, _))
52+
hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::TryTraitBranch, ..))
5353
) {
5454
check_map_error(cx, arg_0, expr);
5555
}

src/tools/clippy/clippy_lints/src/utils/author.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
260260
}
261261

262262
fn qpath(&self, qpath: &Binding<&QPath<'_>>) {
263-
if let QPath::LangItem(lang_item, _) = *qpath.value {
263+
if let QPath::LangItem(lang_item, ..) = *qpath.value {
264264
out!("if matches!({qpath}, QPath::LangItem(LangItem::{lang_item:?}, _));");
265265
} else {
266266
out!("if match_qpath({qpath}, &[{}]);", path_to_string(qpath.value));

src/tools/clippy/clippy_utils/src/higher.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl<'a> Range<'a> {
218218
hir::ExprKind::Call(path, args)
219219
if matches!(
220220
path.kind,
221-
hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::RangeInclusiveNew, _))
221+
hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::RangeInclusiveNew, ..))
222222
) =>
223223
{
224224
Some(Range {
@@ -228,27 +228,27 @@ impl<'a> Range<'a> {
228228
})
229229
},
230230
hir::ExprKind::Struct(path, fields, None) => match &path {
231-
hir::QPath::LangItem(hir::LangItem::RangeFull, _) => Some(Range {
231+
hir::QPath::LangItem(hir::LangItem::RangeFull, ..) => Some(Range {
232232
start: None,
233233
end: None,
234234
limits: ast::RangeLimits::HalfOpen,
235235
}),
236-
hir::QPath::LangItem(hir::LangItem::RangeFrom, _) => Some(Range {
236+
hir::QPath::LangItem(hir::LangItem::RangeFrom, ..) => Some(Range {
237237
start: Some(get_field("start", fields)?),
238238
end: None,
239239
limits: ast::RangeLimits::HalfOpen,
240240
}),
241-
hir::QPath::LangItem(hir::LangItem::Range, _) => Some(Range {
241+
hir::QPath::LangItem(hir::LangItem::Range, ..) => Some(Range {
242242
start: Some(get_field("start", fields)?),
243243
end: Some(get_field("end", fields)?),
244244
limits: ast::RangeLimits::HalfOpen,
245245
}),
246-
hir::QPath::LangItem(hir::LangItem::RangeToInclusive, _) => Some(Range {
246+
hir::QPath::LangItem(hir::LangItem::RangeToInclusive, ..) => Some(Range {
247247
start: None,
248248
end: Some(get_field("end", fields)?),
249249
limits: ast::RangeLimits::Closed,
250250
}),
251-
hir::QPath::LangItem(hir::LangItem::RangeTo, _) => Some(Range {
251+
hir::QPath::LangItem(hir::LangItem::RangeTo, ..) => Some(Range {
252252
start: None,
253253
end: Some(get_field("end", fields)?),
254254
limits: ast::RangeLimits::HalfOpen,

src/tools/clippy/clippy_utils/src/hir_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl HirEqInterExpr<'_, '_, '_> {
346346
(&QPath::TypeRelative(lty, lseg), &QPath::TypeRelative(rty, rseg)) => {
347347
self.eq_ty(lty, rty) && self.eq_path_segment(lseg, rseg)
348348
},
349-
(&QPath::LangItem(llang_item, _), &QPath::LangItem(rlang_item, _)) => llang_item == rlang_item,
349+
(&QPath::LangItem(llang_item, ..), &QPath::LangItem(rlang_item, ..)) => llang_item == rlang_item,
350350
_ => false,
351351
}
352352
}

0 commit comments

Comments
 (0)