Skip to content

Commit 4e04e62

Browse files
committed
---
yaml --- r: 271623 b: refs/heads/auto c: 8988c45 h: refs/heads/master i: 271621: 638c303 271619: 0a56cf3 271615: 761c85b
1 parent d00168a commit 4e04e62

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 43dffc329402d99a93e224bba1a30f587c70dc7d
11+
refs/heads/auto: 8988c4538e30bce6985cc0b8458521d9a4a87277
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc_resolve/resolve_imports.rs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
397397
::std::mem::swap(&mut imports, &mut unresolved_imports);
398398

399399
for import_directive in imports {
400-
match self.resolve_import_for_module(&import_directive) {
400+
match self.resolve_import(&import_directive) {
401401
Failed(err) => {
402402
let (span, help) = match err {
403403
Some((span, msg)) => (span, format!(". {}", msg)),
@@ -411,7 +411,11 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
411411
});
412412
}
413413
Indeterminate => unresolved_imports.push(import_directive),
414-
Success(()) => {}
414+
Success(()) => {
415+
// Decrement the count of unresolved imports.
416+
assert!(self.resolver.unresolved_imports >= 1);
417+
self.resolver.unresolved_imports -= 1;
418+
}
415419
}
416420
}
417421
}
@@ -421,25 +425,19 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
421425
/// don't know whether the name exists at the moment due to other
422426
/// currently-unresolved imports, or success if we know the name exists.
423427
/// If successful, the resolved bindings are written into the module.
424-
fn resolve_import_for_module(&mut self, directive: &'b ImportDirective) -> ResolveResult<()> {
428+
fn resolve_import(&mut self, directive: &'b ImportDirective) -> ResolveResult<()> {
425429
debug!("(resolving import for module) resolving import `{}::...` in `{}`",
426430
names_to_string(&directive.module_path),
427431
module_to_string(self.resolver.current_module));
428432

429-
self.resolver
430-
.resolve_module_path(&directive.module_path, DontUseLexicalScope, directive.span)
431-
// Once we have the module that contains the target, we can resolve the import.
432-
.and_then(|containing_module| self.resolve_import(containing_module, directive))
433-
.and_then(|()| {
434-
// Decrement the count of unresolved imports.
435-
assert!(self.resolver.unresolved_imports >= 1);
436-
self.resolver.unresolved_imports -= 1;
437-
Success(())
438-
})
439-
}
433+
let target_module = match self.resolver.resolve_module_path(&directive.module_path,
434+
DontUseLexicalScope,
435+
directive.span) {
436+
Success(module) => module,
437+
Indeterminate => return Indeterminate,
438+
Failed(err) => return Failed(err),
439+
};
440440

441-
fn resolve_import(&mut self, target_module: Module<'b>, directive: &'b ImportDirective)
442-
-> ResolveResult<()> {
443441
let (source, target, value_determined, type_determined) = match directive.subclass {
444442
SingleImport { source, target, ref value_determined, ref type_determined } =>
445443
(source, target, value_determined, type_determined),

0 commit comments

Comments
 (0)