Skip to content

Commit 7143445

Browse files
nagisaDavid Wood
authored andcommitted
Clean up documentation
The first paragraph of the documentation ends up as a summary line on rustdoc; having it be a single short sentence integrates well with this behaviour.
1 parent cc88b75 commit 7143445

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

thorin/src/error.rs

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,37 @@ impl<'a, T: StdError + 'a> AsDynError<'a> for T {
1919
#[derive(Debug)]
2020
#[non_exhaustive]
2121
pub enum Error {
22-
/// Failure to read input file, this error occurs in the `Session::read_input` function
23-
/// provided by the user of `thorin`.
22+
/// Failure to read input file.
23+
///
24+
/// This error occurs in the `Session::read_input` function provided by the user of `thorin`.
2425
ReadInput(std::io::Error),
25-
/// Failed to parse kind of input file. Input file kind is necessary to determine how to parse
26-
/// the rest of the input, and to validate that the input file is of a type that `thorin` can
27-
/// process.
26+
/// Failed to parse kind of input file.
27+
///
28+
/// Input file kind is necessary to determine how to parse the rest of the input, and to
29+
/// validate that the input file is of a type that `thorin` can process.
2830
ParseFileKind(object::Error),
2931
/// Failed to parse object file.
3032
ParseObjectFile(object::Error),
3133
/// Failed to parse archive file.
3234
ParseArchiveFile(object::Error),
3335
/// Failed to parse archive member.
3436
ParseArchiveMember(object::Error),
35-
/// Invalid kind of input. Only archive and elf files are supported input files.
37+
/// Invalid kind of input.
38+
///
39+
/// Only archive and elf files are supported input files.
3640
InvalidInputKind,
37-
/// Failed to decompress data. `thorin` uses `object` for decompression, so `object` probably
38-
/// didn't have support for the type of compression used.
41+
/// Failed to decompress data.
42+
///
43+
/// `thorin` uses `object` for decompression, so `object` probably didn't have support for the
44+
/// type of compression used.
3945
DecompressData(object::Error),
4046
/// Section without a name.
4147
NamelessSection(object::Error, usize),
4248
/// Relocation has invalid symbol for a section.
4349
RelocationWithInvalidSymbol(String, usize),
4450
/// Multiple relocations for a section.
4551
MultipleRelocations(String, usize),
46-
/// Unsupport relocations for a section.
52+
/// Unsupported relocations for a section.
4753
UnsupportedRelocation(String, usize),
4854
/// Input object that has a `DwoId` (or `DebugTypeSignature`) does not have a
4955
/// `DW_AT_GNU_dwo_name` or `DW_AT_dwo_name` attribute.
@@ -72,8 +78,10 @@ pub enum Error {
7278
OffsetAtIndex(gimli::read::Error, u64),
7379
/// Failed to read string from `.debug_str` at offset.
7480
StrAtOffset(gimli::read::Error, usize),
75-
/// Failed to parse index section. If an input file is a DWARF package, its index section needs
76-
/// to be read to ensure that the contributions within it are preserved.
81+
/// Failed to parse index section.
82+
///
83+
/// If an input file is a DWARF package, its index section needs to be read to ensure that the
84+
/// contributions within it are preserved.
7785
ParseIndex(gimli::read::Error, String),
7886
/// Compilation unit in DWARF package is not its index.
7987
UnitNotInIndex(u64),

thorin/src/ext.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ pub(crate) trait CompressedDataRangeExt<'input, 'session: 'input>:
2222
ObjectSection<'input>
2323
{
2424
/// Return the decompressed contents of the section data in the given range.
25+
///
26+
/// Decompression happens only if the data is compressed.
2527
fn compressed_data_range(
2628
&self,
2729
sess: &'session impl Session<RelocationMap>,
@@ -96,7 +98,9 @@ impl<'input, Endian: gimli::Endianity> IndexSectionExt<'input, Endian, EndianSli
9698
pub(crate) trait PackageFormatExt {
9799
/// Returns `true` if this `Encoding` would produce to a DWARF 5-standardized package file.
98100
///
99-
/// See Sec 7.3.5 and Appendix F of [DWARF specification](https://dwarfstd.org/doc/DWARF5.pdf).
101+
/// See Sec 7.3.5 and Appendix F of the [DWARF specification].
102+
///
103+
/// [DWARF specification]: https://dwarfstd.org/doc/DWARF5.pdf
100104
fn is_std_dwarf_package_format(&self) -> bool;
101105

102106
/// Returns `true` if this `Encoding` would produce a GNU Extension DWARF package file

thorin/src/package.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,10 @@ impl<'file> InProgressDwarfPackage<'file> {
424424
&self.contained_units
425425
}
426426

427-
/// Process an input DWARF object. Copies relevant sections, compilation/type units and strings
428-
/// from DWARF object into output object.
427+
/// Process an input DWARF object.
428+
///
429+
/// Copies relevant debug sections, compilation/type units and strings from the `input` DWARF
430+
/// object into this DWARF package.
429431
#[tracing::instrument(level = "trace", skip(sess, input,))]
430432
pub(crate) fn add_input_object<'input, 'session: 'input>(
431433
&mut self,

0 commit comments

Comments
 (0)