Change ty.kind to a method
This commit is contained in:
@@ -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()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user