Skip to content

Commit

Permalink
Compare Tys directly instead of their TyKinds
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Apr 3, 2019
1 parent 076abfa commit c81ce06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
);

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

0 comments on commit c81ce06

Please sign in to comment.