summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-08-27 21:14:13 +0800
committerJohn Hodge <tpg@mutabah.net>2016-08-27 21:14:13 +0800
commit7e1d0d14853df9d2a6cd664a99547d192ba5dbe5 (patch)
treee1bce651700da7ab9e00010e27b499d41ef6a8b7 /src
parentd2f604f09befa888dd9a8915189c8928053ae908 (diff)
downloadmrust-7e1d0d14853df9d2a6cd664a99547d192ba5dbe5.tar.gz
Resolve - (bugfix) Fix crash when missing item is in root
Diffstat (limited to 'src')
-rw-r--r--src/resolve/use.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp
index e68580ee..3ddee7c2 100644
--- a/src/resolve/use.cpp
+++ b/src/resolve/use.cpp
@@ -293,7 +293,7 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path
}
}
- if( mod.path().nodes().back().name()[0] == '#' ) {
+ if( mod.path().nodes().size() > 0 && mod.path().nodes().back().name()[0] == '#' ) {
assert( parent_modules.size() > 0 );
return Resolve_Use_GetBinding_Mod(span, crate, *parent_modules.back(), des_item_name, parent_modules.subslice(0, parent_modules.size()-1));
}