File tree Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -1019,27 +1019,26 @@ impl Literal {
10191019
10201020 #[ cfg( span_locations) ]
10211021 {
1022- use crate :: convert:: usize_to_u32;
10231022 use core:: ops:: Bound ;
10241023
10251024 let lo = match range. start_bound ( ) {
10261025 Bound :: Included ( start) => {
1027- let start = usize_to_u32 ( * start) ?;
1026+ let start = u32 :: try_from ( * start) . ok ( ) ?;
10281027 self . span . lo . checked_add ( start) ?
10291028 }
10301029 Bound :: Excluded ( start) => {
1031- let start = usize_to_u32 ( * start) ?;
1030+ let start = u32 :: try_from ( * start) . ok ( ) ?;
10321031 self . span . lo . checked_add ( start) ?. checked_add ( 1 ) ?
10331032 }
10341033 Bound :: Unbounded => self . span . lo ,
10351034 } ;
10361035 let hi = match range. end_bound ( ) {
10371036 Bound :: Included ( end) => {
1038- let end = usize_to_u32 ( * end) ?;
1037+ let end = u32 :: try_from ( * end) . ok ( ) ?;
10391038 self . span . lo . checked_add ( end) ?. checked_add ( 1 ) ?
10401039 }
10411040 Bound :: Excluded ( end) => {
1042- let end = usize_to_u32 ( * end) ?;
1041+ let end = u32 :: try_from ( * end) . ok ( ) ?;
10431042 self . span . lo . checked_add ( end) ?
10441043 }
10451044 Bound :: Unbounded => self . span . hi ,
Original file line number Diff line number Diff line change @@ -141,8 +141,6 @@ use crate::fallback as imp;
141141#[ cfg( wrap_proc_macro) ]
142142mod imp;
143143
144- #[ cfg( span_locations) ]
145- mod convert;
146144#[ cfg( span_locations) ]
147145mod location;
148146
You can’t perform that action at this time.
0 commit comments