mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-05 03:23:25 +00:00
Appease the clippy
This commit is contained in:
parent
fa7633dda1
commit
4e23448c49
@ -61,7 +61,7 @@ pub(super) fn check(
|
|||||||
// ? is a Call, makes sure not to rec *x?, but rather (*x)?
|
// ? is a Call, makes sure not to rec *x?, but rather (*x)?
|
||||||
ExprKind::Call(hir_callee, _) => matches!(
|
ExprKind::Call(hir_callee, _) => matches!(
|
||||||
hir_callee.kind,
|
hir_callee.kind,
|
||||||
ExprKind::Path(QPath::LangItem(rustc_hir::LangItem::TryTraitBranch, _, _))
|
ExprKind::Path(QPath::LangItem(rustc_hir::LangItem::TryTraitBranch, ..))
|
||||||
),
|
),
|
||||||
ExprKind::MethodCall(_, self_arg, ..) if expr.hir_id == self_arg.hir_id => true,
|
ExprKind::MethodCall(_, self_arg, ..) if expr.hir_id == self_arg.hir_id => true,
|
||||||
ExprKind::Match(_, _, MatchSource::TryDesugar(_) | MatchSource::AwaitDesugar)
|
ExprKind::Match(_, _, MatchSource::TryDesugar(_) | MatchSource::AwaitDesugar)
|
||||||
|
@ -309,7 +309,7 @@ fn check_final_expr<'tcx>(
|
|||||||
let replacement = if let Some(inner_expr) = inner {
|
let replacement = if let Some(inner_expr) = inner {
|
||||||
// if desugar of `do yeet`, don't lint
|
// if desugar of `do yeet`, don't lint
|
||||||
if let ExprKind::Call(path_expr, _) = inner_expr.kind
|
if let ExprKind::Call(path_expr, _) = inner_expr.kind
|
||||||
&& let ExprKind::Path(QPath::LangItem(LangItem::TryTraitFromYeet, _, _)) = path_expr.kind
|
&& let ExprKind::Path(QPath::LangItem(LangItem::TryTraitFromYeet, ..)) = path_expr.kind
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryMapOnConstructor {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
hir::QPath::TypeRelative(_, path) => path.ident.name,
|
hir::QPath::TypeRelative(_, path) => path.ident.name,
|
||||||
hir::QPath::LangItem(_, _, _) => return,
|
hir::QPath::LangItem(..) => return,
|
||||||
};
|
};
|
||||||
match constructor_symbol {
|
match constructor_symbol {
|
||||||
sym::Some | sym::Ok if path.ident.name == rustc_span::sym::map => (),
|
sym::Some | sym::Ok if path.ident.name == rustc_span::sym::map => (),
|
||||||
|
@ -170,7 +170,7 @@ fn qpath_certainty(cx: &LateContext<'_>, qpath: &QPath<'_>, resolves_to_type: bo
|
|||||||
path_segment_certainty(cx, type_certainty(cx, ty), path_segment, resolves_to_type)
|
path_segment_certainty(cx, type_certainty(cx, ty), path_segment, resolves_to_type)
|
||||||
},
|
},
|
||||||
|
|
||||||
QPath::LangItem(lang_item, _, _) => {
|
QPath::LangItem(lang_item, ..) => {
|
||||||
cx.tcx
|
cx.tcx
|
||||||
.lang_items()
|
.lang_items()
|
||||||
.get(*lang_item)
|
.get(*lang_item)
|
||||||
|
Loading…
Reference in New Issue
Block a user