diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-03-19 21:10:43 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-03-19 21:10:43 +0800 |
commit | 33ef03560680b32734f713fe7810e1f4ce5affa8 (patch) | |
tree | 078a73ca05c96a75c8e84fa024764070ab4e074b | |
parent | 071dfa6990aefd97c019f6f07e98a58717f7b3c0 (diff) | |
download | mrust-33ef03560680b32734f713fe7810e1f4ce5affa8.tar.gz |
Expand - Handle #[main] on deleted object
-rw-r--r-- | src/expand/lang_item.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/expand/lang_item.cpp b/src/expand/lang_item.cpp index 0a5c87f5..988dc0e0 100644 --- a/src/expand/lang_item.cpp +++ b/src/expand/lang_item.cpp @@ -187,7 +187,10 @@ public: AttrStage stage() const override { return AttrStage::Post; } void handle(const Span& sp, const AST::MetaItem& attr, AST::Crate& crate, const AST::Path& path, AST::Module& mod, AST::Item& i) const override { - TU_IFLET(::AST::Item, i, Function, e, + if( i.is_None() ) { + // Ignore. + } + else TU_IFLET(::AST::Item, i, Function, e, auto rv = crate.m_lang_items.insert(::std::make_pair( ::std::string("mrustc-main"), ::AST::Path(path) )); if( !rv.second ) { |