Update faerie, remove usage of failure (#591)

This commit removes the usage of the `failure` crate and finishes up the
final pieces of the migration to `std::error::Error` and `anyhow`. The
`faerie` crate was updated to pull in its migration from `failure` to
`anyhow` as well.
This commit is contained in:
Alex Crichton
2019-11-18 16:26:37 -06:00
committed by Dan Gohman
parent 9182971697
commit f2718a9573
15 changed files with 19 additions and 20 deletions

View File

@@ -1,5 +1,4 @@
use alloc::{string::String, vec::Vec};
use core::result;
use faerie::artifact::{Decl, SectionKind};
use faerie::*;
use gimli::write::{Address, Dwarf, EndianVec, Result, Sections, Writer};
@@ -26,19 +25,19 @@ pub fn emit_dwarf(
artifact: &mut Artifact,
mut dwarf: Dwarf,
symbol_resolver: &dyn SymbolResolver,
) -> result::Result<(), failure::Error> {
) -> anyhow::Result<()> {
let endian = RunTimeEndian::Little;
let mut sections = Sections::new(WriterRelocate::new(endian, symbol_resolver));
dwarf.write(&mut sections)?;
sections.for_each_mut(|id, s| -> result::Result<(), failure::Error> {
sections.for_each_mut(|id, s| -> anyhow::Result<()> {
artifact.declare_with(
id.name(),
Decl::section(SectionKind::Debug),
s.writer.take(),
)
})?;
sections.for_each_mut(|id, s| -> result::Result<(), failure::Error> {
sections.for_each_mut(|id, s| -> anyhow::Result<()> {
for reloc in &s.relocs {
artifact.link_with(
faerie::Link {