@@ -47,7 +47,7 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
4747
4848 let bar = get_item ( & items, ( DefKind :: Fn , "bar" ) ) . unwrap ( ) ;
4949 let body = bar. body ( ) ;
50- assert_eq ! ( body. locals. len( ) , 2 ) ;
50+ assert_eq ! ( body. locals( ) . len( ) , 2 ) ;
5151 assert_eq ! ( body. blocks. len( ) , 1 ) ;
5252 let block = & body. blocks [ 0 ] ;
5353 assert_eq ! ( block. statements. len( ) , 1 ) ;
@@ -62,7 +62,7 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
6262
6363 let foo_bar = get_item ( & items, ( DefKind :: Fn , "foo_bar" ) ) . unwrap ( ) ;
6464 let body = foo_bar. body ( ) ;
65- assert_eq ! ( body. locals. len( ) , 5 ) ;
65+ assert_eq ! ( body. locals( ) . len( ) , 5 ) ;
6666 assert_eq ! ( body. blocks. len( ) , 4 ) ;
6767 let block = & body. blocks [ 0 ] ;
6868 match & block. terminator . kind {
@@ -72,29 +72,29 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
7272
7373 let types = get_item ( & items, ( DefKind :: Fn , "types" ) ) . unwrap ( ) ;
7474 let body = types. body ( ) ;
75- assert_eq ! ( body. locals. len( ) , 6 ) ;
75+ assert_eq ! ( body. locals( ) . len( ) , 6 ) ;
7676 assert_matches ! (
77- body. locals[ 0 ] . ty. kind( ) ,
77+ body. locals( ) [ 0 ] . ty. kind( ) ,
7878 stable_mir:: ty:: TyKind :: RigidTy ( stable_mir:: ty:: RigidTy :: Bool )
7979 ) ;
8080 assert_matches ! (
81- body. locals[ 1 ] . ty. kind( ) ,
81+ body. locals( ) [ 1 ] . ty. kind( ) ,
8282 stable_mir:: ty:: TyKind :: RigidTy ( stable_mir:: ty:: RigidTy :: Bool )
8383 ) ;
8484 assert_matches ! (
85- body. locals[ 2 ] . ty. kind( ) ,
85+ body. locals( ) [ 2 ] . ty. kind( ) ,
8686 stable_mir:: ty:: TyKind :: RigidTy ( stable_mir:: ty:: RigidTy :: Char )
8787 ) ;
8888 assert_matches ! (
89- body. locals[ 3 ] . ty. kind( ) ,
89+ body. locals( ) [ 3 ] . ty. kind( ) ,
9090 stable_mir:: ty:: TyKind :: RigidTy ( stable_mir:: ty:: RigidTy :: Int ( stable_mir:: ty:: IntTy :: I32 ) )
9191 ) ;
9292 assert_matches ! (
93- body. locals[ 4 ] . ty. kind( ) ,
93+ body. locals( ) [ 4 ] . ty. kind( ) ,
9494 stable_mir:: ty:: TyKind :: RigidTy ( stable_mir:: ty:: RigidTy :: Uint ( stable_mir:: ty:: UintTy :: U64 ) )
9595 ) ;
9696 assert_matches ! (
97- body. locals[ 5 ] . ty. kind( ) ,
97+ body. locals( ) [ 5 ] . ty. kind( ) ,
9898 stable_mir:: ty:: TyKind :: RigidTy ( stable_mir:: ty:: RigidTy :: Float (
9999 stable_mir:: ty:: FloatTy :: F64
100100 ) )
@@ -123,10 +123,10 @@ fn test_stable_mir(_tcx: TyCtxt<'_>) -> ControlFlow<()> {
123123 for block in instance. body ( ) . blocks {
124124 match & block. terminator . kind {
125125 stable_mir:: mir:: TerminatorKind :: Call { func, .. } => {
126- let TyKind :: RigidTy ( ty) = func. ty ( & body. locals ) . kind ( ) else { unreachable ! ( ) } ;
126+ let TyKind :: RigidTy ( ty) = func. ty ( & body. locals ( ) ) . kind ( ) else { unreachable ! ( ) } ;
127127 let RigidTy :: FnDef ( def, args) = ty else { unreachable ! ( ) } ;
128128 let next_func = Instance :: resolve ( def, & args) . unwrap ( ) ;
129- match next_func. body ( ) . locals [ 1 ] . ty . kind ( ) {
129+ match next_func. body ( ) . locals ( ) [ 1 ] . ty . kind ( ) {
130130 TyKind :: RigidTy ( RigidTy :: Uint ( _) ) | TyKind :: RigidTy ( RigidTy :: Tuple ( _) ) => { }
131131 other => panic ! ( "{other:?}" ) ,
132132 }
0 commit comments