diff --git a/src/lib.rs b/src/lib.rs index 213e2cbd..c69823c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,15 +9,15 @@ //! Cargo features that can be enabled with `gimli`: //! //! * `std`: Enabled by default. Use the `std` library. Disabling this feature -//! allows using `gimli` in embedded environments that do not have access to -//! `std`. Note that even when `std` is disabled, `gimli` still requires an -//! implementation of the `alloc` crate. +//! allows using `gimli` in embedded environments that do not have access to +//! `std`. Note that even when `std` is disabled, `gimli` still requires an +//! implementation of the `alloc` crate. //! //! * `read`: Enabled by default. Enables the `read` module. Use of `std` is -//! optional. +//! optional. //! //! * `write`: Enabled by default. Enables the `write` module. Always uses -//! the `std` library. +//! the `std` library. #![deny(missing_docs)] #![deny(missing_debug_implementations)] // Selectively enable rust 2018 warnings diff --git a/src/read/cfi.rs b/src/read/cfi.rs index 37b9ebb4..72b19cc2 100644 --- a/src/read/cfi.rs +++ b/src/read/cfi.rs @@ -3752,7 +3752,6 @@ mod tests { use alloc::vec::Vec; use core::marker::PhantomData; use core::mem; - use core::u64; use test_assembler::{Endian, Label, LabelMaker, LabelOrNum, Section, ToLabelOrNum}; // Ensure each test tries to read the same section kind that it wrote. @@ -6850,7 +6849,7 @@ mod tests { fn test_eh_frame_resolve_cie_offset_underflow() { let buf = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; assert_eq!( - resolve_cie_offset(&buf, ::core::usize::MAX), + resolve_cie_offset(&buf, usize::MAX), Err(Error::OffsetOutOfBounds) ); } diff --git a/src/read/dwarf.rs b/src/read/dwarf.rs index 1b3e1a59..d61d76f1 100644 --- a/src/read/dwarf.rs +++ b/src/read/dwarf.rs @@ -399,9 +399,9 @@ impl Dwarf { /// - an inline `DW_FORM_string` string /// - a `DW_FORM_strp` reference to an offset into the `.debug_str` section /// - a `DW_FORM_strp_sup` reference to an offset into a supplementary - /// object file + /// object file /// - a `DW_FORM_line_strp` reference to an offset into the `.debug_line_str` - /// section + /// section /// - a `DW_FORM_strx` index into the `.debug_str_offsets` entries for the unit /// /// then return the attribute's string value. Returns an error if the attribute diff --git a/src/read/line.rs b/src/read/line.rs index 4ea31261..c4d2e28c 100644 --- a/src/read/line.rs +++ b/src/read/line.rs @@ -276,10 +276,10 @@ where /// > 1. Add a signed integer to the line register. /// > /// > 2. Modify the operation pointer by incrementing the address and - /// > op_index registers as described below. + /// > op_index registers as described below. /// > /// > 3. Append a row to the matrix using the current values of the state - /// > machine registers. + /// > machine registers. /// > /// > 4. Set the basic_block register to “false.” /// > diff --git a/src/read/mod.rs b/src/read/mod.rs index 42542cc3..e855aa74 100644 --- a/src/read/mod.rs +++ b/src/read/mod.rs @@ -64,22 +64,22 @@ //! * Basic familiarity with DWARF is assumed. //! //! * The [`Dwarf`](./struct.Dwarf.html) type contains the commonly used DWARF -//! sections. It has methods that simplify access to debugging data that spans -//! multiple sections. Use of this type is optional, but recommended. +//! sections. It has methods that simplify access to debugging data that spans +//! multiple sections. Use of this type is optional, but recommended. //! //! * The [`DwarfPackage`](./struct.Dwarf.html) type contains the DWARF -//! package (DWP) sections. It has methods to find a DWARF object (DWO) -//! within the package. +//! package (DWP) sections. It has methods to find a DWARF object (DWO) +//! within the package. //! //! * Each section gets its own type. Consider these types the entry points to -//! the library: +//! the library: //! //! * [`DebugAbbrev`](./struct.DebugAbbrev.html): The `.debug_abbrev` section. //! //! * [`DebugAddr`](./struct.DebugAddr.html): The `.debug_addr` section. //! //! * [`DebugAranges`](./struct.DebugAranges.html): The `.debug_aranges` -//! section. +//! section. //! //! * [`DebugFrame`](./struct.DebugFrame.html): The `.debug_frame` section. //! @@ -94,10 +94,10 @@ //! * [`DebugLocLists`](./struct.DebugLocLists.html): The `.debug_loclists` section. //! //! * [`DebugPubNames`](./struct.DebugPubNames.html): The `.debug_pubnames` -//! section. +//! section. //! //! * [`DebugPubTypes`](./struct.DebugPubTypes.html): The `.debug_pubtypes` -//! section. +//! section. //! //! * [`DebugRanges`](./struct.DebugRanges.html): The `.debug_ranges` section. //! @@ -118,15 +118,15 @@ //! * [`EhFrameHdr`](./struct.EhFrameHdr.html): The `.eh_frame_hdr` section. //! //! * Each section type exposes methods for accessing the debugging data encoded -//! in that section. For example, the [`DebugInfo`](./struct.DebugInfo.html) -//! struct has the [`units`](./struct.DebugInfo.html#method.units) method for -//! iterating over the compilation units defined within it. +//! in that section. For example, the [`DebugInfo`](./struct.DebugInfo.html) +//! struct has the [`units`](./struct.DebugInfo.html#method.units) method for +//! iterating over the compilation units defined within it. //! //! * Offsets into a section are strongly typed: an offset into `.debug_info` is -//! the [`DebugInfoOffset`](./struct.DebugInfoOffset.html) type. It cannot be -//! used to index into the [`DebugLine`](./struct.DebugLine.html) type because -//! `DebugLine` represents the `.debug_line` section. There are similar types -//! for offsets relative to a compilation unit rather than a section. +//! the [`DebugInfoOffset`](./struct.DebugInfoOffset.html) type. It cannot be +//! used to index into the [`DebugLine`](./struct.DebugLine.html) type because +//! `DebugLine` represents the `.debug_line` section. There are similar types +//! for offsets relative to a compilation unit rather than a section. //! //! ## Using with `FallibleIterator` //! diff --git a/src/read/op.rs b/src/read/op.rs index 2d2ba46c..42d3cee8 100644 --- a/src/read/op.rs +++ b/src/read/op.rs @@ -2022,7 +2022,6 @@ mod tests { use crate::leb128; use crate::read::{EndianSlice, Error, Result, UnitOffset}; use crate::test_util::GimliSectionMethods; - use core::usize; use test_assembler::{Endian, Section}; fn encoding4() -> Encoding { diff --git a/src/read/unit.rs b/src/read/unit.rs index 6b755bcb..58bb3a38 100644 --- a/src/read/unit.rs +++ b/src/read/unit.rs @@ -4196,28 +4196,24 @@ mod tests { )] = &[ (AttributeValue::Data1(1), Some(1), Some(1)), ( - AttributeValue::Data1(core::u8::MAX), - Some(u64::from(std::u8::MAX)), + AttributeValue::Data1(u8::MAX), + Some(u64::from(u8::MAX)), Some(-1), ), (AttributeValue::Data2(1), Some(1), Some(1)), ( - AttributeValue::Data2(core::u16::MAX), - Some(u64::from(std::u16::MAX)), + AttributeValue::Data2(u16::MAX), + Some(u64::from(u16::MAX)), Some(-1), ), (AttributeValue::Data4(1), Some(1), Some(1)), ( - AttributeValue::Data4(core::u32::MAX), - Some(u64::from(std::u32::MAX)), + AttributeValue::Data4(u32::MAX), + Some(u64::from(u32::MAX)), Some(-1), ), (AttributeValue::Data8(1), Some(1), Some(1)), - ( - AttributeValue::Data8(core::u64::MAX), - Some(core::u64::MAX), - Some(-1), - ), + (AttributeValue::Data8(u64::MAX), Some(u64::MAX), Some(-1)), (AttributeValue::Sdata(1), Some(1), Some(1)), (AttributeValue::Sdata(-1), None, Some(-1)), (AttributeValue::Udata(1), Some(1), Some(1)), diff --git a/src/write/mod.rs b/src/write/mod.rs index b3b894e9..b7adbbe2 100644 --- a/src/write/mod.rs +++ b/src/write/mod.rs @@ -6,10 +6,10 @@ //! in memory, and then writing it all at once. It supports two major use cases: //! //! * Use the [`DwarfUnit`](./struct.DwarfUnit.html) type when writing DWARF -//! for a single compilation unit. +//! for a single compilation unit. //! //! * Use the [`Dwarf`](./struct.Dwarf.html) type when writing DWARF for multiple -//! compilation units. +//! compilation units. //! //! The module also supports reading in DWARF debugging information and writing it out //! again, possibly after modifying it. Create a [`read::Dwarf`](../read/struct.Dwarf.html) diff --git a/src/write/writer.rs b/src/write/writer.rs index 1ce3641f..9ee071bf 100644 --- a/src/write/writer.rs +++ b/src/write/writer.rs @@ -329,7 +329,6 @@ mod tests { use super::*; use crate::write; use crate::{BigEndian, LittleEndian}; - use std::{i64, u64}; #[test] fn test_writer() {