Skip to content

Commit c81ce06

Browse files
committed
Compare Tys directly instead of their TyKinds
1 parent 076abfa commit c81ce06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_typeck/astconv.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
591591
);
592592

593593
let is_object = self_ty.map_or(false, |ty| {
594-
ty.sty == self.tcx().types.trait_object_dummy_self.sty
594+
ty == self.tcx().types.trait_object_dummy_self
595595
});
596596
let default_needs_object_self = |param: &ty::GenericParamDef| {
597597
if let GenericParamDefKind::Type { has_default, .. } = param.kind {
@@ -956,7 +956,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
956956
/// removing the dummy `Self` type (`trait_object_dummy_self`).
957957
fn trait_ref_to_existential(&self, trait_ref: ty::TraitRef<'tcx>)
958958
-> ty::ExistentialTraitRef<'tcx> {
959-
if trait_ref.self_ty().sty != self.tcx().types.trait_object_dummy_self.sty {
959+
if trait_ref.self_ty() != self.tcx().types.trait_object_dummy_self {
960960
bug!("trait_ref_to_existential called on {:?} with non-dummy Self", trait_ref);
961961
}
962962
ty::ExistentialTraitRef::erase_self_ty(self.tcx(), trait_ref)

0 commit comments

Comments
 (0)