Skip to content

Commit 3309f02

Browse files
committed
make hir::Ty/ConstArg methods generic where applicable
1 parent 6ed9588 commit 3309f02

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/extra_unused_type_parameters.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl<'tcx> Visitor<'tcx> for TypeWalker<'_, 'tcx> {
197197
type NestedFilter = nested_filter::OnlyBodies;
198198

199199
fn visit_ty(&mut self, t: &'tcx Ty<'tcx, AmbigArg>) {
200-
if let Some((def_id, _)) = t.as_unambig_ty().peel_refs().as_generic_param() {
200+
if let Some((def_id, _)) = t.peel_refs().as_generic_param() {
201201
self.ty_params.remove(&def_id);
202202
} else {
203203
walk_ty(self, t);

clippy_lints/src/from_over_into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<'tcx> LateLintPass<'tcx> for FromOverInto {
9292
|diag| {
9393
// If the target type is likely foreign mention the orphan rules as it's a common source of
9494
// confusion
95-
if path_def_id(cx, target_ty.as_unambig_ty().peel_refs()).is_none_or(|id| !id.is_local()) {
95+
if path_def_id(cx, target_ty.peel_refs()).is_none_or(|id| !id.is_local()) {
9696
diag.help(
9797
"`impl From<Local> for Foreign` is allowed by the orphan rules, for more information see\n\
9898
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence"

0 commit comments

Comments
 (0)