diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-29 16:07:28 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-29 16:07:28 +0800 |
commit | 4c5e8ffbd413772859739e8cad57f925ba85dad8 (patch) | |
tree | d22427268aeee7a91b88ee1746845d7a1b74032d /src/expand/std_prelude.cpp | |
parent | a8da316a2646428acb780e889b322edf5f00549e (diff) | |
download | mrust-4c5e8ffbd413772859739e8cad57f925ba85dad8.tar.gz |
AST Resolve - Prelude handling
Diffstat (limited to 'src/expand/std_prelude.cpp')
-rw-r--r-- | src/expand/std_prelude.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/expand/std_prelude.cpp b/src/expand/std_prelude.cpp index b7493570..a46740a7 100644 --- a/src/expand/std_prelude.cpp +++ b/src/expand/std_prelude.cpp @@ -41,6 +41,15 @@ class Decorator_NoPrelude: { public: AttrStage stage() const override { return AttrStage::EarlyPre; } + + void handle(const Span& sp, const AST::MetaItem& mi, ::AST::Crate& crate, const AST::Path& path, AST::Module& mod, AST::Item&i) const override { + if( i.is_Module() ) { + i.as_Module().m_insert_prelude = false; + } + else { + ERROR(sp, E0000, "Invalid use of #[no_prelude] on non-module"); + } + } }; |