summaryrefslogtreecommitdiff
path: root/src/expand/lang_item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/expand/lang_item.cpp')
-rw-r--r--src/expand/lang_item.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/expand/lang_item.cpp b/src/expand/lang_item.cpp
index 186f2cea..f8aea8c3 100644
--- a/src/expand/lang_item.cpp
+++ b/src/expand/lang_item.cpp
@@ -103,7 +103,11 @@ void handle_lang_item(const Span& sp, AST::Crate& crate, const AST::Path& path,
auto rv = crate.m_lang_items.insert( ::std::make_pair( name, ::AST::Path(path) ) );
if( !rv.second ) {
- ERROR(sp, E0000, "Duplicate definition of language item '" << name << "' - " << rv.first->second << " and " << path);
+ const auto& other_path = rv.first->second;
+ if( path != other_path ) {
+ // HACK: Anon modules get visited twice, so can lead to duplicate annotations
+ ERROR(sp, E0000, "Duplicate definition of language item '" << name << "' - " << other_path << " and " << path);
+ }
}
}