Skip to content

Commit 45b639a

Browse files
davidtwcoDavid Wood
authored andcommitted
remove unused error variants
Some `Error` variants are no longer used after earlier refactorings. Signed-off-by: David Wood <[email protected]>
1 parent 070b3cc commit 45b639a

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

thorin/src/error.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ impl<'a, T: StdError + 'a> AsDynError<'a> for T {
1717

1818
/// Diagnostics (and contexts) emitted during DWARF packaging.
1919
#[derive(Debug)]
20+
#[non_exhaustive]
2021
pub enum Error {
2122
/// Failure to read input file, this error occurs in the `Session::read_input` function
2223
/// provided by the user of `thorin`.
@@ -67,14 +68,10 @@ pub enum Error {
6768
ParseUnit(gimli::read::Error),
6869
/// Input DWARF package has a different index version than the version being output.
6970
IncompatibleIndexVersion(String, u16, u16),
70-
/// Failed to add a section to the output object.
71-
AppendSection(object::Error, &'static str),
7271
/// Failed to read string offset from `.debug_str_offsets` at index.
7372
OffsetAtIndex(gimli::read::Error, u64),
7473
/// Failed to read string from `.debug_str` at offset.
7574
StrAtOffset(gimli::read::Error, usize),
76-
/// Failed to write string to string table.
77-
WritingStrToStringTable(gimli::write::Error),
7875
/// Failed to parse index section. If an input file is a DWARF package, its index section needs
7976
/// to be read to ensure that the contributions within it are preserved.
8077
ParseIndex(gimli::read::Error, String),
@@ -139,10 +136,8 @@ impl StdError for Error {
139136
Error::ParseUnitHeader(source) => Some(source.as_dyn_error()),
140137
Error::ParseUnit(source) => Some(source.as_dyn_error()),
141138
Error::IncompatibleIndexVersion(_, _, _) => None,
142-
Error::AppendSection(source, _) => Some(source.as_dyn_error()),
143139
Error::OffsetAtIndex(source, _) => Some(source.as_dyn_error()),
144140
Error::StrAtOffset(source, _) => Some(source.as_dyn_error()),
145-
Error::WritingStrToStringTable(source) => Some(source.as_dyn_error()),
146141
Error::ParseIndex(source, _) => Some(source.as_dyn_error()),
147142
Error::UnitNotInIndex(_) => None,
148143
Error::RowNotInIndex(source, _) => Some(source.as_dyn_error()),
@@ -221,9 +216,6 @@ impl fmt::Display for Error {
221216
section, actual, format
222217
)
223218
}
224-
Error::AppendSection(_, section) => {
225-
write!(f, "Failed to concatenate `{}` section from input DWARF object", section)
226-
}
227219
Error::OffsetAtIndex(_, index) => write!(
228220
f,
229221
"Failed to read offset at index {} of `.debug_str_offsets.dwo` section",
@@ -234,9 +226,6 @@ impl fmt::Display for Error {
234226
"Failed to read string at offset {:08x} of `.debug_str.dwo` section",
235227
offset
236228
),
237-
Error::WritingStrToStringTable(_) => {
238-
write!(f, "Failed to write string to in-progress `.debug_str.dwo` section")
239-
}
240229
Error::ParseIndex(_, section) => write!(f, "Failed to parse `{}` section", section),
241230
Error::UnitNotInIndex(unit) => {
242231
write!(f, "Unit 0x{0:08x} from input DWARF package is not in its index", unit)

0 commit comments

Comments
 (0)