]> git.lizzy.rs Git - rust.git/commitdiff
Use `&'hir Ty` everywhere.
authorNicholas Nethercote <n.nethercote@gmail.com>
Fri, 26 Aug 2022 05:57:44 +0000 (15:57 +1000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Sun, 28 Aug 2022 20:35:14 +0000 (06:35 +1000)
For consistency, and because it makes HIR measurement simpler and more
accurate.

clippy_lints/src/manual_bits.rs
clippy_utils/src/lib.rs

index 60bbcde4f1de566b2ab100acc675130691ba61cd..940601a44fb072c370e82e1d435c8acde6bc6dbf 100644 (file)
@@ -105,7 +105,7 @@ fn get_size_of_ty<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<
         if let Some(def_id) = cx.qpath_res(count_func_qpath, count_func.hir_id).opt_def_id();
         if cx.tcx.is_diagnostic_item(sym::mem_size_of, def_id);
         then {
-            cx.typeck_results().node_substs(count_func.hir_id).types().next().map(|resolved_ty| (real_ty, resolved_ty))
+            cx.typeck_results().node_substs(count_func.hir_id).types().next().map(|resolved_ty| (*real_ty, resolved_ty))
         } else {
             None
         }
index dd1ceb6a4dc481864574e7660897677f8cf53532..42ce3b6bf0fca24a95fb21d10a083e8b661c6b48 100644 (file)
@@ -333,7 +333,7 @@ pub fn qpath_generic_tys<'tcx>(qpath: &QPath<'tcx>) -> impl Iterator<Item = &'tc
         .map_or(&[][..], |a| a.args)
         .iter()
         .filter_map(|a| match a {
-            hir::GenericArg::Type(ty) => Some(ty),
+            hir::GenericArg::Type(ty) => Some(*ty),
             _ => None,
         })
 }