summaryrefslogtreecommitdiff
path: root/src/expand/mod.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-08-29 19:56:00 +0800
committerJohn Hodge <tpg@mutabah.net>2016-08-29 19:56:00 +0800
commit2dba62cd0b042fd4a3c543a14c214cf49600fdee (patch)
treec259180b1d08fc147e789658447f120421824e07 /src/expand/mod.cpp
parent7dd8c0bc78603bb73537571047704889d33f7fbb (diff)
downloadmrust-2dba62cd0b042fd4a3c543a14c214cf49600fdee.tar.gz
Expand - Core crate name for for desugar
Diffstat (limited to 'src/expand/mod.cpp')
-rw-r--r--src/expand/mod.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/expand/mod.cpp b/src/expand/mod.cpp
index 097ab77f..33ba207f 100644
--- a/src/expand/mod.cpp
+++ b/src/expand/mod.cpp
@@ -356,10 +356,11 @@ struct CExpandExpr:
Expand_Pattern(is_early, crate, modstack, this->cur_mod(), node.m_pattern);
if(node.m_type == ::AST::ExprNode_Loop::FOR)
{
- auto path_Some = ::AST::Path("", {::AST::PathNode("option"), ::AST::PathNode("Option"), ::AST::PathNode("Some")});
- auto path_None = ::AST::Path("", {::AST::PathNode("option"), ::AST::PathNode("Option"), ::AST::PathNode("None")});
- auto path_IntoIterator = ::AST::Path("", {::AST::PathNode("iter"), ::AST::PathNode("IntoIterator")});
- auto path_Iterator = ::AST::Path("", {::AST::PathNode("iter"), ::AST::PathNode("Iterator")});
+ auto core_crate = (crate.m_load_std == ::AST::Crate::LOAD_NONE ? "" : "core");
+ auto path_Some = ::AST::Path(core_crate, {::AST::PathNode("option"), ::AST::PathNode("Option"), ::AST::PathNode("Some")});
+ auto path_None = ::AST::Path(core_crate, {::AST::PathNode("option"), ::AST::PathNode("Option"), ::AST::PathNode("None")});
+ auto path_IntoIterator = ::AST::Path(core_crate, {::AST::PathNode("iter"), ::AST::PathNode("IntoIterator")});
+ auto path_Iterator = ::AST::Path(core_crate, {::AST::PathNode("iter"), ::AST::PathNode("Iterator")});
// Desugar into:
// {
// match <_ as ::iter::IntoIterator>::into_iter(`m_cond`) {