Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@ryansg.com>2020-04-20 15:39:22 -0400
committerMike Gerwitz <mike.gerwitz@ryansg.com>2020-04-28 09:06:25 -0400
commit21a0bdcce1dd36f59578e2eb8f4207e769f028eb (patch)
treeb1c5f98f736e84dde2654d1d925f6122ad395c28 /tamer/src/ld/poc.rs
parentef79a763ace14cccc19b49262c4769ff25e0fa54 (diff)
downloadtame-21a0bdcce1dd36f59578e2eb8f4207e769f028eb.tar.gz
tame-21a0bdcce1dd36f59578e2eb8f4207e769f028eb.tar.bz2
tame-21a0bdcce1dd36f59578e2eb8f4207e769f028eb.zip
[DEV-7084] TAMER: AsgBuilderError: Introduce proper error variants
This is a union (sum type) of three other errors types, plus errors specific to this builder. This commit does a good job demonstrating the boilerplate, as well as a need for additional context (in the case of `IdentKindError`), that we'll want to work on abstracting away.
Diffstat (limited to 'tamer/src/ld/poc.rs')
-rw-r--r--tamer/src/ld/poc.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tamer/src/ld/poc.rs b/tamer/src/ld/poc.rs
index 32a965a..0515a76 100644
--- a/tamer/src/ld/poc.rs
+++ b/tamer/src/ld/poc.rs
@@ -29,7 +29,7 @@ use crate::ir::asg::{
SortableAsg,
};
use crate::obj::xmle::writer::XmleWriter;
-use crate::obj::xmlo::reader::{XmloError, XmloReader};
+use crate::obj::xmlo::reader::XmloReader;
use crate::obj::xmlo::{AsgBuilder, AsgBuilderState};
use crate::sym::{DefaultInterner, Interner, Symbol};
use fxhash::FxBuildHasher;
@@ -148,11 +148,11 @@ fn load_xmlo<'a, 'i, I: Interner<'i>, P: AsRef<Path>>(
fn get_ident<'a, 'i>(
depgraph: &'a LinkerAsg<'i>,
name: &'i Symbol<'i>,
-) -> Result<&'a IdentObject<'i>, XmloError> {
+) -> Result<&'a IdentObject<'i>, String> {
depgraph
.lookup(name)
.and_then(|id| depgraph.get(id))
- .ok_or(XmloError::MissingFragment(String::from(name as &str)))
+ .ok_or(format!("missing identifier: {}", name))
}
fn output_xmle<'a, 'i, I: Interner<'i>>(