Skip to content

Commit

Permalink
Fix uses of TraitRef::identity in clippy and rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Apr 26, 2023
1 parent 39b95c9 commit 689721d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ fn clean_generic_bound<'tcx>(
hir::GenericBound::LangItemTrait(lang_item, span, _, generic_args) => {
let def_id = cx.tcx.require_lang_item(lang_item, Some(span));

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

let generic_args = clean_generic_args(generic_args, cx);
let GenericArgs::AngleBracketed { bindings, .. } = generic_args
Expand Down
3 changes: 1 addition & 2 deletions src/tools/clippy/clippy_lints/src/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
if trait_item.kind == (AssocItemKind::Fn { has_self: true }) {
trait_self_ty = Some(
TraitRef::identity(cx.tcx, trait_item.id.owner_id.to_def_id())
.self_ty()
.skip_binder(),
.self_ty(),
);
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/tools/clippy/clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3500,8 +3500,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
let first_arg_span = first_arg_ty.span;
let first_arg_ty = hir_ty_to_ty(cx.tcx, first_arg_ty);
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
.self_ty()
.skip_binder();
.self_ty();
wrong_self_convention::check(
cx,
item.ident.name.as_str(),
Expand All @@ -3519,8 +3518,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
if let TraitItemKind::Fn(_, _) = item.kind;
let ret_ty = return_ty(cx, item.owner_id);
let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id())
.self_ty()
.skip_binder();
.self_ty();
if !ret_ty.contains(self_ty);

then {
Expand Down

0 comments on commit 689721d

Please sign in to comment.