// In this case, target_module == module_
// This means we are trying to glob import a module into itself,
// and it is a no-go
- return ResolveResult::Indeterminate;
+ debug!("(resolving glob imports) target module is current module; giving up");
+ return ResolveResult::Failed(Some((
+ import_directive.span,
+ "Cannot glob-import a module into itself.".into()
+ )));
}
for (ident, target_import_resolution) in import_resolutions.iter() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use self::*; //~ ERROR: unresolved import
+use self::*; //~ ERROR: unresolved import `self::*`. Cannot glob-import a module into itself.
+
+mod foo {
+ use foo::*; //~ ERROR: unresolved import `foo::*`. Cannot glob-import a module into itself.
+
+ mod bar {
+ use super::bar::*;
+ //~^ ERROR: unresolved import `super::bar::*`. Cannot glob-import a module into itself.
+ }
+
+}
fn main() {
}