Skip to content

Commit 5f6f32b

Browse files
committed
---
yaml --- r: 273897 b: refs/heads/beta c: 6f09dea h: refs/heads/master i: 273895: 65219f6
1 parent 17255b2 commit 5f6f32b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-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: 3d9db595661a96c37f4a5f9cf310c20da08efa5f
26+
refs/heads/beta: 6f09deaa32ba8a4f26a46c28ffecbb3efc3d165e
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_resolve/resolve_imports.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,14 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
537537
match (&value_result, &type_result) {
538538
(&Indeterminate, _) | (_, &Indeterminate) => return Indeterminate,
539539
(&Failed(_), &Failed(_)) => {
540-
let children = target_module.resolutions.borrow();
541-
let names = children.keys().map(|&(ref name, _)| name);
540+
let resolutions = target_module.resolutions.borrow();
541+
let names = resolutions.iter().filter_map(|(&(ref name, _), resolution)| {
542+
match *resolution.borrow() {
543+
NameResolution { binding: Some(_), .. } => Some(name),
544+
NameResolution { single_imports: SingleImports::None, .. } => None,
545+
_ => Some(name),
546+
}
547+
});
542548
let lev_suggestion = match find_best_match_for_name(names, &source.as_str(), None) {
543549
Some(name) => format!(". Did you mean to use `{}`?", name),
544550
None => "".to_owned(),

0 commit comments

Comments
 (0)