Skip to content

Commit 5c0e172

Browse files
committed
s/try_to_usize/try_to_machine_usize/
1 parent a871fed commit 5c0e172

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc_middle/mir/interpret/value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<'tcx> ConstValue<'tcx> {
6868
}
6969
}
7070

71-
pub fn try_to_usize(&self, tcx: TyCtxt<'tcx>) -> Option<u64> {
71+
pub fn try_to_machine_usize(&self, tcx: TyCtxt<'tcx>) -> Option<u64> {
7272
Some(self.try_to_bits(tcx.data_layout.pointer_size)? as u64)
7373
}
7474

src/librustc_middle/ty/sty.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2423,7 +2423,7 @@ impl<'tcx> Const<'tcx> {
24232423

24242424
#[inline]
24252425
pub fn try_eval_usize(&self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> Option<u64> {
2426-
self.val.eval(tcx, param_env).try_to_usize(tcx)
2426+
self.val.eval(tcx, param_env).try_to_machine_usize(tcx)
24272427
}
24282428

24292429
#[inline]
@@ -2494,8 +2494,8 @@ impl<'tcx> ConstKind<'tcx> {
24942494
}
24952495

24962496
#[inline]
2497-
pub fn try_to_usize(self, tcx: TyCtxt<'tcx>) -> Option<u64> {
2498-
self.try_to_value()?.try_to_usize(tcx)
2497+
pub fn try_to_machine_usize(self, tcx: TyCtxt<'tcx>) -> Option<u64> {
2498+
self.try_to_value()?.try_to_machine_usize(tcx)
24992499
}
25002500
}
25012501

0 commit comments

Comments
 (0)