mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Fix clippy
This commit is contained in:
parent
9d72808b1e
commit
2beb6a4782
@ -77,7 +77,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, msrv: &Msrv) {
|
||||
|
||||
let (help, final_suggestion) = if let Some(method) = omit_cast.corresponding_item() {
|
||||
// don't force absolute path
|
||||
let method = qpath_to_string(method);
|
||||
let method = qpath_to_string(&cx.tcx, method);
|
||||
("try call directly", format!("{method}{turbofish}()"))
|
||||
} else {
|
||||
let cast_expr_sugg = Sugg::hir_with_applicability(cx, cast_expr, "_", &mut app);
|
||||
|
@ -19,7 +19,7 @@ pub(crate) fn check<'tcx>(cx: &LateContext<'tcx>, ex: &Expr<'tcx>, arms: &[Arm<'
|
||||
if is_type_diagnostic_item(cx, ex_ty, sym::Result) {
|
||||
for arm in arms {
|
||||
if let PatKind::TupleStruct(ref path, inner, _) = arm.pat.kind {
|
||||
let path_str = rustc_hir_pretty::qpath_to_string(path);
|
||||
let path_str = rustc_hir_pretty::qpath_to_string(&cx.tcx, path);
|
||||
if path_str == "Err" {
|
||||
let mut matching_wild = inner.iter().any(is_wild);
|
||||
let mut ident_bind_name = kw::Underscore;
|
||||
|
@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryMutPassed {
|
||||
cx,
|
||||
arguments.iter().collect(),
|
||||
cx.typeck_results().expr_ty(fn_expr),
|
||||
&rustc_hir_pretty::qpath_to_string(path),
|
||||
&rustc_hir_pretty::qpath_to_string(&cx.tcx, path),
|
||||
"function",
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user