mem_replace_with_default: use diagnostic items intead of paths

This commit is contained in:
Mateusz Gacek
2021-03-12 12:00:08 -08:00
parent c86ba7f92d
commit 41be515062
3 changed files with 35 additions and 24 deletions

View File

@@ -279,7 +279,7 @@ pub fn match_trait_method(cx: &LateContext<'_>, expr: &Expr<'_>, path: &[&str])
trt_id.map_or(false, |trt_id| match_def_path(cx, trt_id, path))
}
/// Checks if the method call given in `expr` belongs to a trait or other container with a given
/// Checks if the method call given in `def_id` belongs to a trait or other container with a given
/// diagnostic item
pub fn is_diagnostic_assoc_item(cx: &LateContext<'_>, def_id: DefId, diag_item: Symbol) -> bool {
cx.tcx