Change ty.kind to a method

This commit is contained in:
LeSeulArtichaut
2020-08-03 00:49:11 +02:00
parent ef55a0a92f
commit 3e14b684dd
189 changed files with 947 additions and 899 deletions

View File

@@ -580,7 +580,9 @@ bitflags! {
#[allow(rustc::usage_of_ty_tykind)]
pub struct TyS<'tcx> {
pub kind: TyKind<'tcx>,
/// This field shouldn't be used directly and may be removed in the future.
/// Use `TyS::kind()` instead.
kind: TyKind<'tcx>,
pub flags: TypeFlags,
/// This is a kind of confusing thing: it stores the smallest
@@ -609,13 +611,13 @@ static_assert_size!(TyS<'_>, 32);
impl<'tcx> Ord for TyS<'tcx> {
fn cmp(&self, other: &TyS<'tcx>) -> Ordering {
self.kind.cmp(&other.kind)
self.kind().cmp(other.kind())
}
}
impl<'tcx> PartialOrd for TyS<'tcx> {
fn partial_cmp(&self, other: &TyS<'tcx>) -> Option<Ordering> {
Some(self.kind.cmp(&other.kind))
Some(self.kind().cmp(other.kind()))
}
}