diff options
author | John Hodge <tpg@mutabah.net> | 2017-08-22 19:46:41 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2017-08-22 19:46:41 +0800 |
commit | 1fbd12d2954f22b96f8da0ae9bc3e0b091d9a838 (patch) | |
tree | b48002f853fdb3702f74345e70c17d8a1176964b | |
parent | f62e4179bd7a4a893bf62686ef82f0a93b1cd970 (diff) | |
download | mrust-1fbd12d2954f22b96f8da0ae9bc3e0b091d9a838.tar.gz |
Expand - allow #![no_std] or #![no_core] to be repeated
-rw-r--r-- | src/expand/std_prelude.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/expand/std_prelude.cpp b/src/expand/std_prelude.cpp index 16c4ce90..e12a441c 100644 --- a/src/expand/std_prelude.cpp +++ b/src/expand/std_prelude.cpp @@ -8,9 +8,9 @@ class Decorator_NoStd: { public: AttrStage stage() const override { return AttrStage::Pre; } - + void handle(const Span& sp, const AST::MetaItem& mi, AST::Crate& crate) const override { - if( crate.m_load_std != AST::Crate::LOAD_STD ) { + if( crate.m_load_std != AST::Crate::LOAD_STD && crate.m_load_std != AST::Crate::LOAD_CORE ) { ERROR(sp, E0000, "Invalid use of #![no_std] with itself or #![no_core]"); } crate.m_load_std = AST::Crate::LOAD_CORE; @@ -23,7 +23,7 @@ public: AttrStage stage() const override { return AttrStage::Pre; } void handle(const Span& sp, const AST::MetaItem& mi, AST::Crate& crate) const override { - if( crate.m_load_std != AST::Crate::LOAD_STD ) { + if( crate.m_load_std != AST::Crate::LOAD_STD && crate.m_load_std != AST::Crate::LOAD_NONE ) { ERROR(sp, E0000, "Invalid use of #![no_core] with itself or #![no_std]"); } crate.m_load_std = AST::Crate::LOAD_NONE; |