File tree 2 files changed +2
-3
lines changed
compiler/stable_mir/src/mir
2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -1057,8 +1057,7 @@ impl Place {
1057
1057
/// In order to retrieve the correct type, the `locals` argument must match the list of all
1058
1058
/// locals from the function body where this place originates from.
1059
1059
pub fn ty ( & self , locals : & [ LocalDecl ] ) -> Result < Ty , Error > {
1060
- let start_ty = locals[ self . local ] . ty ;
1061
- self . projection . iter ( ) . fold ( Ok ( start_ty) , |place_ty, elem| elem. ty ( place_ty?) )
1060
+ self . projection . iter ( ) . try_fold ( locals[ self . local ] . ty , |place_ty, elem| elem. ty ( place_ty) )
1062
1061
}
1063
1062
}
1064
1063
Original file line number Diff line number Diff line change @@ -563,7 +563,7 @@ pub struct PlaceRef<'a> {
563
563
impl PlaceRef < ' _ > {
564
564
/// Get the type of this place.
565
565
pub fn ty ( & self , locals : & [ LocalDecl ] ) -> Result < Ty , Error > {
566
- self . projection . iter ( ) . fold ( Ok ( locals[ self . local ] . ty ) , |place_ty, elem| elem. ty ( place_ty? ) )
566
+ self . projection . iter ( ) . try_fold ( locals[ self . local ] . ty , |place_ty, elem| elem. ty ( place_ty) )
567
567
}
568
568
}
569
569
You can’t perform that action at this time.
0 commit comments