diff options
| author | flip1995 <hello@philkrones.com> | 2019-04-03 16:08:04 +0200 |
|---|---|---|
| committer | flip1995 <hello@philkrones.com> | 2019-04-03 19:18:07 +0200 |
| commit | c81ce069b4ea7586d3c15df4a45fd43159e1a0fa (patch) | |
| tree | 61fa359032143640554bd8e6f10332323992e69b | |
| parent | 076abfa0f30e2365f4dbb6cd941c7761157b644a (diff) | |
| download | rust-c81ce069b4ea7586d3c15df4a45fd43159e1a0fa.tar.gz rust-c81ce069b4ea7586d3c15df4a45fd43159e1a0fa.zip | |
Compare `Ty`s directly instead of their `TyKind`s
| -rw-r--r-- | src/librustc_typeck/astconv.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index ab5c2fee0ae..8805dade40e 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -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 { @@ -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) |
