Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/tamer
diff options
context:
space:
mode:
authorJoseph Frazer <joseph.frazer@ryansg.com>2020-03-16 12:50:41 -0400
committerJoseph Frazer <joseph.frazer@ryansg.com>2020-03-26 08:48:43 -0400
commit59f194a46a55e7d88e092c4340a605cf68b19617 (patch)
treea9c007563f9b07dbedcd45883b70d0b9cad48277 /tamer
parent7a4f6cf9f21cba15b221fc382cba6f41daa82b10 (diff)
downloadtame-59f194a46a55e7d88e092c4340a605cf68b19617.tar.gz
tame-59f194a46a55e7d88e092c4340a605cf68b19617.tar.bz2
tame-59f194a46a55e7d88e092c4340a605cf68b19617.zip
[DEV-7133] Add AsgError::Cycle
We want a special error type when we detect cyclic dependencies.
Diffstat (limited to 'tamer')
-rw-r--r--tamer/src/ir/asg/graph.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tamer/src/ir/asg/graph.rs b/tamer/src/ir/asg/graph.rs
index bf7d30c..f3fcb55 100644
--- a/tamer/src/ir/asg/graph.rs
+++ b/tamer/src/ir/asg/graph.rs
@@ -238,6 +238,8 @@ pub enum AsgError {
/// The node was not expected in the current context
UnexpectedNode(String),
+ /// The graph has a cyclic dependency
+ Cycle(String),
}
impl std::fmt::Display for AsgError {
@@ -252,6 +254,9 @@ impl std::fmt::Display for AsgError {
Self::UnexpectedNode(msg) => {
write!(fmt, "unexpected node: {}", msg)
}
+ Self::Cycle(msg) => {
+ write!(fmt, "Cyclic dependency detected: {}", msg)
+ }
}
}
}