Skip to content

Commit 0a3eac4

Browse files
committed
---
yaml --- r: 233196 b: refs/heads/beta c: 5847ea7 h: refs/heads/master v: v3
1 parent 9d8bedb commit 0a3eac4

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 3d041bd46dfbd77a392228b6e4c0cb866d4404fc
26+
refs/heads/beta: 5847ea76195d9cbe9d066418bdf44ba2a0398649
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_resolve/resolve_imports.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,11 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
785785
// In this case, target_module == module_
786786
// This means we are trying to glob import a module into itself,
787787
// and it is a no-go
788-
return ResolveResult::Indeterminate;
788+
debug!("(resolving glob imports) target module is current module; giving up");
789+
return ResolveResult::Failed(Some((
790+
import_directive.span,
791+
"Cannot glob-import a module into itself.".into()
792+
)));
789793
}
790794

791795
for (ident, target_import_resolution) in import_resolutions.iter() {

branches/beta/src/test/compile-fail/issue-8208.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use self::*; //~ ERROR: unresolved import
11+
use self::*; //~ ERROR: unresolved import `self::*`. Cannot glob-import a module into itself.
12+
13+
mod foo {
14+
use foo::*; //~ ERROR: unresolved import `foo::*`. Cannot glob-import a module into itself.
15+
16+
mod bar {
17+
use super::bar::*;
18+
//~^ ERROR: unresolved import `super::bar::*`. Cannot glob-import a module into itself.
19+
}
20+
21+
}
1222

1323
fn main() {
1424
}

0 commit comments

Comments
 (0)