diff options
| author | John Hodge <tpg@mutabah.net> | 2019-11-03 11:59:35 +0800 |
|---|---|---|
| committer | John Hodge <tpg@mutabah.net> | 2019-11-03 11:59:35 +0800 |
| commit | 56c9b3f6f9c4e9e34477b19b5abf25193dbc3a41 (patch) | |
| tree | d0b1983ab77eae175086f2587522bddccb47980e /src/hir | |
| parent | 0a2ea1a773c54c3a4b02edfeb19123aa4224c735 (diff) | |
| download | mrust-56c9b3f6f9c4e9e34477b19b5abf25193dbc3a41.tar.gz | |
HIR Expand Closures - Move closure prefix to a common location
Diffstat (limited to 'src/hir')
| -rw-r--r-- | src/hir/type.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hir/type.hpp b/src/hir/type.hpp index cbc2e94a..f499c73f 100644 --- a/src/hir/type.hpp +++ b/src/hir/type.hpp @@ -17,6 +17,8 @@ /// Binding index for a Generic that indicates "Self" #define GENERIC_Self 0xFFFF +constexpr const char* CLOSURE_PATH_PREFIX = "closure#"; + namespace HIR { class TraitMarkings; @@ -209,7 +211,7 @@ public: bool is_closure() const { return path.m_data.is_Generic() && path.m_data.as_Generic().m_path.m_components.back().size() > 8 - && path.m_data.as_Generic().m_path.m_components.back().compare(0,8, "closure#") == 0 + && path.m_data.as_Generic().m_path.m_components.back().compare(0,strlen(CLOSURE_PATH_PREFIX), CLOSURE_PATH_PREFIX) == 0 ; } }), |
