diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-09-08 21:39:13 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2020-09-19 06:54:42 +0200 |
| commit | 1e2dba1e7cf15442257f2cd3ddfe5d0462ee9102 (patch) | |
| tree | 402ea425d8883c2c501f563220fddf001d0f91c2 /library/panic_unwind/src | |
| parent | 5c30a16fa03efaf87241b363f4323743746c12b0 (diff) | |
| download | rust-1e2dba1e7cf15442257f2cd3ddfe5d0462ee9102.tar.gz rust-1e2dba1e7cf15442257f2cd3ddfe5d0462ee9102.zip | |
Use `T::BITS` instead of `size_of::<T> * 8`.
Diffstat (limited to 'library/panic_unwind/src')
| -rw-r--r-- | library/panic_unwind/src/dwarf/mod.rs | 4 | ||||
| -rw-r--r-- | library/panic_unwind/src/lib.rs | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/library/panic_unwind/src/dwarf/mod.rs b/library/panic_unwind/src/dwarf/mod.rs index 649bbce52a3..652fbe95a14 100644 --- a/library/panic_unwind/src/dwarf/mod.rs +++ b/library/panic_unwind/src/dwarf/mod.rs @@ -53,7 +53,7 @@ impl DwarfReader { } pub unsafe fn read_sleb128(&mut self) -> i64 { - let mut shift: usize = 0; + let mut shift: u32 = 0; let mut result: u64 = 0; let mut byte: u8; loop { @@ -65,7 +65,7 @@ impl DwarfReader { } } // sign-extend - if shift < 8 * mem::size_of::<u64>() && (byte & 0x40) != 0 { + if shift < u64::BITS && (byte & 0x40) != 0 { result |= (!0 as u64) << shift; } result as i64 diff --git a/library/panic_unwind/src/lib.rs b/library/panic_unwind/src/lib.rs index 6f31e6dcae7..162f0386b66 100644 --- a/library/panic_unwind/src/lib.rs +++ b/library/panic_unwind/src/lib.rs @@ -18,6 +18,7 @@ issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/" )] #![feature(core_intrinsics)] +#![feature(int_bits_const)] #![feature(lang_items)] #![feature(libc)] #![feature(nll)] |
