diff options
| author | bors <bors@rust-lang.org> | 2020-09-25 06:23:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-09-25 06:23:55 +0000 |
| commit | 6273be6fc26b22f91389a67a30c6633d60cc459d (patch) | |
| tree | 882bb8c78e662a6130049429d513d3556e299369 /clippy_lints/src/path_buf_push_overwrite.rs | |
| parent | a8c60732786626928fe9dceb1ffe0775a2700969 (diff) | |
| parent | d1f9cad102b5686f2b827f3c62a02dfe419128a6 (diff) | |
Auto merge of #77144 - flip1995:clippyup, r=Manishearth
Update Clippy Bi-weekly Clippy update. This includes a `Cargo.lock` update (d445493479711389f4dea3a0f433041077ba2088), so probably needs `rollup=never`. r? `@Manishearth`
Diffstat (limited to 'clippy_lints/src/path_buf_push_overwrite.rs')
| -rw-r--r-- | clippy_lints/src/path_buf_push_overwrite.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/path_buf_push_overwrite.rs b/clippy_lints/src/path_buf_push_overwrite.rs index b8583402928..6eeb031d383 100644 --- a/clippy_lints/src/path_buf_push_overwrite.rs +++ b/clippy_lints/src/path_buf_push_overwrite.rs @@ -1,4 +1,4 @@ -use crate::utils::{match_type, paths, span_lint_and_sugg, walk_ptrs_ty}; +use crate::utils::{match_type, paths, span_lint_and_sugg}; use if_chain::if_chain; use rustc_ast::ast::LitKind; use rustc_errors::Applicability; @@ -46,7 +46,7 @@ impl<'tcx> LateLintPass<'tcx> for PathBufPushOverwrite { if let ExprKind::MethodCall(ref path, _, ref args, _) = expr.kind; if path.ident.name == sym!(push); if args.len() == 2; - if match_type(cx, walk_ptrs_ty(cx.typeck_results().expr_ty(&args[0])), &paths::PATH_BUF); + if match_type(cx, cx.typeck_results().expr_ty(&args[0]).peel_refs(), &paths::PATH_BUF); if let Some(get_index_arg) = args.get(1); if let ExprKind::Lit(ref lit) = get_index_arg.kind; if let LitKind::Str(ref path_lit, _) = lit.node; |
