summaryrefslogtreecommitdiff
path: root/src/ast/path.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-01-30 15:41:15 +0800
committerJohn Hodge <tpg@mutabah.net>2016-01-30 15:41:15 +0800
commite3cf598517bf45317df0891462d71fa0b20dd1b9 (patch)
tree9c359e49507faa9c36e0c3ebb6612a8c26271a0a /src/ast/path.hpp
parentbc4c6189980d2fc1c8e753b9cd614699652ecba7 (diff)
downloadmrust-e3cf598517bf45317df0891462d71fa0b20dd1b9.tar.gz
A whole lot of messing around for not much
Diffstat (limited to 'src/ast/path.hpp')
-rw-r--r--src/ast/path.hpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ast/path.hpp b/src/ast/path.hpp
index a2178a8a..4f019b08 100644
--- a/src/ast/path.hpp
+++ b/src/ast/path.hpp
@@ -252,15 +252,17 @@ public:
void match_args(const Path& other, ::std::function<void(const char*,const TypeRef&)> fcn) const;
bool is_trivial() const {
- switch(m_class.tag())
- {
- case Class::Local: return true;
- case Class::Relative: {
- auto& e = m_class.as_Relative();
+ TU_MATCH_DEF(Class, (m_class), (e),
+ (
+ return false;
+ ),
+ (Local,
+ return true;
+ ),
+ (Relative,
return e.nodes.size() == 1 && e.nodes[0].args().size() == 0;
- }
- default: return false;
- }
+ )
+ )
}
bool is_valid() const { return !m_class.is_Invalid(); }