summaryrefslogtreecommitdiff
path: root/src/ast/path.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2015-03-25 22:41:25 +0800
committerJohn Hodge <tpg@mutabah.net>2015-03-25 22:41:25 +0800
commit7fef87364af0fea2ef5db89385674c9c3b892ec2 (patch)
treef011c29fc8c9477a298674fc12abced0972bdb43 /src/ast/path.hpp
parentbcdff39b26a01904b0a33f2bdb80bb7f6cac37f7 (diff)
downloadmrust-7fef87364af0fea2ef5db89385674c9c3b892ec2.tar.gz
Add flag for irrefutable matches, prevents arguments from being resolved
Diffstat (limited to 'src/ast/path.hpp')
-rw-r--r--src/ast/path.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ast/path.hpp b/src/ast/path.hpp
index c2b345df..03aeab23 100644
--- a/src/ast/path.hpp
+++ b/src/ast/path.hpp
@@ -188,6 +188,10 @@ public:
void resolve(const Crate& crate);
+ bool is_trivial() const {
+ return m_class == RELATIVE && m_nodes.size() == 1 && m_nodes[0].args().size() == 0;
+ }
+
bool is_absolute() const { return m_class == ABSOLUTE; }
bool is_relative() const { return m_class == RELATIVE; }
size_t size() const { return m_nodes.size(); }