Skip to content

Commit 99f9dcf

Browse files
committed
---
yaml --- r: 229319 b: refs/heads/try c: 5847ea7 h: refs/heads/master i: 229317: 03f3323 229315: fc6cf1d 229311: 11fcded v: v3
1 parent 1282ca4 commit 99f9dcf

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 3d041bd46dfbd77a392228b6e4c0cb866d4404fc
4+
refs/heads/try: 5847ea76195d9cbe9d066418bdf44ba2a0398649
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/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/try/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)