Skip to content

Commit 689721d

Browse files
committed
Fix uses of TraitRef::identity in clippy and rustdoc
1 parent 39b95c9 commit 689721d

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fn clean_generic_bound<'tcx>(
131131
hir::GenericBound::LangItemTrait(lang_item, span, _, generic_args) => {
132132
let def_id = cx.tcx.require_lang_item(lang_item, Some(span));
133133

134-
let trait_ref = ty::TraitRef::identity(cx.tcx, def_id);
134+
let trait_ref = ty::Binder::dummy(ty::TraitRef::identity(cx.tcx, def_id));
135135

136136
let generic_args = clean_generic_args(generic_args, cx);
137137
let GenericArgs::AngleBracketed { bindings, .. } = generic_args

src/tools/clippy/clippy_lints/src/escape.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
9494
if trait_item.kind == (AssocItemKind::Fn { has_self: true }) {
9595
trait_self_ty = Some(
9696
TraitRef::identity(cx.tcx, trait_item.id.owner_id.to_def_id())
97-
.self_ty()
98-
.skip_binder(),
97+
.self_ty(),
9998
);
10099
}
101100
}

src/tools/clippy/clippy_lints/src/methods/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -3500,8 +3500,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
35003500
let first_arg_span = first_arg_ty.span;
35013501
let first_arg_ty = hir_ty_to_ty(cx.tcx, first_arg_ty);
35023502
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
3503-
.self_ty()
3504-
.skip_binder();
3503+
.self_ty();
35053504
wrong_self_convention::check(
35063505
cx,
35073506
item.ident.name.as_str(),
@@ -3519,8 +3518,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
35193518
if let TraitItemKind::Fn(_, _) = item.kind;
35203519
let ret_ty = return_ty(cx, item.owner_id);
35213520
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
3522-
.self_ty()
3523-
.skip_binder();
3521+
.self_ty();
35243522
if !ret_ty.contains(self_ty);
35253523

35263524
then {

0 commit comments

Comments
 (0)