@@ -124,7 +124,7 @@ impl Constant {
124124 ( & Self :: Str ( ref ls) , & Self :: Str ( ref rs) ) => Some ( ls. cmp ( rs) ) ,
125125 ( & Self :: Char ( ref l) , & Self :: Char ( ref r) ) => Some ( l. cmp ( r) ) ,
126126 ( & Self :: Int ( l) , & Self :: Int ( r) ) => {
127- if let ty:: Int ( int_ty) = cmp_type. sty {
127+ if let ty:: Int ( int_ty) = cmp_type. kind {
128128 Some ( sext ( tcx, l, int_ty) . cmp ( & sext ( tcx, r, int_ty) ) )
129129 } else {
130130 Some ( l. cmp ( & r) )
@@ -161,7 +161,7 @@ pub fn lit_to_constant(lit: &LitKind, ty: Ty<'_>) -> Constant {
161161 LitKind :: ByteStr ( ref s) => Constant :: Binary ( Lrc :: clone ( s) ) ,
162162 LitKind :: Char ( c) => Constant :: Char ( c) ,
163163 LitKind :: Int ( n, _) => Constant :: Int ( n) ,
164- LitKind :: Float ( ref is, _) | LitKind :: FloatUnsuffixed ( ref is) => match ty. sty {
164+ LitKind :: Float ( ref is, _) | LitKind :: FloatUnsuffixed ( ref is) => match ty. kind {
165165 ty:: Float ( FloatTy :: F32 ) => Constant :: F32 ( is. as_str ( ) . parse ( ) . unwrap ( ) ) ,
166166 ty:: Float ( FloatTy :: F64 ) => Constant :: F64 ( is. as_str ( ) . parse ( ) . unwrap ( ) ) ,
167167 _ => bug ! ( ) ,
@@ -229,7 +229,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
229229 ExprKind :: Array ( ref vec) => self . multi ( vec) . map ( Constant :: Vec ) ,
230230 ExprKind :: Tup ( ref tup) => self . multi ( tup) . map ( Constant :: Tuple ) ,
231231 ExprKind :: Repeat ( ref value, _) => {
232- let n = match self . tables . expr_ty ( e) . sty {
232+ let n = match self . tables . expr_ty ( e) . kind {
233233 ty:: Array ( _, n) => n. eval_usize ( self . lcx . tcx , self . lcx . param_env ) ,
234234 _ => span_bug ! ( e. span, "typeck error" ) ,
235235 } ;
@@ -286,7 +286,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
286286 Bool ( b) => Some ( Bool ( !b) ) ,
287287 Int ( value) => {
288288 let value = !value;
289- match ty. sty {
289+ match ty. kind {
290290 ty:: Int ( ity) => Some ( Int ( unsext ( self . lcx . tcx , value as i128 , ity) ) ) ,
291291 ty:: Uint ( ity) => Some ( Int ( clip ( self . lcx . tcx , value, ity) ) ) ,
292292 _ => None ,
@@ -300,7 +300,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
300300 use self :: Constant :: * ;
301301 match * o {
302302 Int ( value) => {
303- let ity = match ty. sty {
303+ let ity = match ty. kind {
304304 ty:: Int ( ity) => ity,
305305 _ => return None ,
306306 } ;
@@ -378,7 +378,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
378378 let l = self . expr ( left) ?;
379379 let r = self . expr ( right) ;
380380 match ( l, r) {
381- ( Constant :: Int ( l) , Some ( Constant :: Int ( r) ) ) => match self . tables . expr_ty ( left) . sty {
381+ ( Constant :: Int ( l) , Some ( Constant :: Int ( r) ) ) => match self . tables . expr_ty ( left) . kind {
382382 ty:: Int ( ity) => {
383383 let l = sext ( self . lcx . tcx , l, ity) ;
384384 let r = sext ( self . lcx . tcx , r, ity) ;
@@ -470,7 +470,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
470470pub fn miri_to_const ( result : & ty:: Const < ' _ > ) -> Option < Constant > {
471471 use rustc:: mir:: interpret:: { ConstValue , Scalar } ;
472472 match result. val {
473- ConstValue :: Scalar ( Scalar :: Raw { data : d, .. } ) => match result. ty . sty {
473+ ConstValue :: Scalar ( Scalar :: Raw { data : d, .. } ) => match result. ty . kind {
474474 ty:: Bool => Some ( Constant :: Bool ( d == 1 ) ) ,
475475 ty:: Uint ( _) | ty:: Int ( _) => Some ( Constant :: Int ( d) ) ,
476476 ty:: Float ( FloatTy :: F32 ) => Some ( Constant :: F32 ( f32:: from_bits (
@@ -480,16 +480,16 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
480480 d. try_into ( ) . expect ( "invalid f64 bit representation" ) ,
481481 ) ) ) ,
482482 ty:: RawPtr ( type_and_mut) => {
483- if let ty:: Uint ( _) = type_and_mut. ty . sty {
483+ if let ty:: Uint ( _) = type_and_mut. ty . kind {
484484 return Some ( Constant :: RawPtr ( d) ) ;
485485 }
486486 None
487487 } ,
488488 // FIXME: implement other conversions.
489489 _ => None ,
490490 } ,
491- ConstValue :: Slice { data, start, end } => match result. ty . sty {
492- ty:: Ref ( _, tam, _) => match tam. sty {
491+ ConstValue :: Slice { data, start, end } => match result. ty . kind {
492+ ty:: Ref ( _, tam, _) => match tam. kind {
493493 ty:: Str => String :: from_utf8 (
494494 data. inspect_with_undef_and_ptr_outside_interpreter ( start..end)
495495 . to_owned ( ) ,
0 commit comments