Skip to content

Commit 88c2914

Browse files
committed
Remove unused resolve error message.
There is not situation where `foo` would be unresolved but not `foo::*`.
1 parent 0919f4a commit 88c2914

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

src/librustc_resolve/lib.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub enum ResolutionError<'a> {
176176
/// error E0431: `self` import can only appear in an import list with a non-empty prefix
177177
SelfImportOnlyInImportListWithNonEmptyPrefix,
178178
/// error E0432: unresolved import
179-
UnresolvedImport(Option<(&'a str, Option<&'a str>)>),
179+
UnresolvedImport(Option<(&'a str, &'a str)>),
180180
/// error E0433: failed to resolve
181181
FailedToResolve(&'a str),
182182
/// error E0434: can't capture dynamic environment in a fn item
@@ -359,8 +359,7 @@ fn resolve_error<'b, 'a:'b, 'tcx:'a>(resolver: &'b Resolver<'a, 'tcx>, span: syn
359359
}
360360
ResolutionError::UnresolvedImport(name) => {
361361
let msg = match name {
362-
Some((n, Some(p))) => format!("unresolved import `{}`{}", n, p),
363-
Some((n, None)) => format!("unresolved import (maybe you meant `{}::*`?)", n),
362+
Some((n, p)) => format!("unresolved import `{}`{}", n, p),
364363
None => "unresolved import".to_owned()
365364
};
366365
span_err!(resolver.session, span, E0432, "{}", msg);
@@ -1815,19 +1814,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
18151814
let imports = module_.imports.borrow();
18161815
let import_count = imports.len();
18171816
if index != import_count {
1818-
let sn = self.session
1819-
.codemap()
1820-
.span_to_snippet((*imports)[index].span)
1821-
.unwrap();
1822-
if sn.contains("::") {
1823-
resolve_error(self,
1824-
(*imports)[index].span,
1825-
ResolutionError::UnresolvedImport(None));
1826-
} else {
1827-
resolve_error(self,
1828-
(*imports)[index].span,
1829-
ResolutionError::UnresolvedImport(Some((&*sn, None))));
1830-
}
1817+
resolve_error(self,
1818+
(*imports)[index].span,
1819+
ResolutionError::UnresolvedImport(None));
18311820
}
18321821

18331822
// Descend into children and anonymous children.

src/librustc_resolve/resolve_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
278278
Some((&*import_path_to_string(
279279
&import_directive.module_path,
280280
import_directive.subclass),
281-
Some(&*help))))
281+
&*help)))
282282
);
283283
}
284284
ResolveResult::Indeterminate => break, // Bail out. We'll come around next time.

0 commit comments

Comments
 (0)