Remove unused resolve error message.
There is not situation where `foo` would be unresolved but not `foo::*`.
This commit is contained in:
parent
0919f4ad86
commit
88c2914e56
2 changed files with 6 additions and 17 deletions
|
|
@ -176,7 +176,7 @@ pub enum ResolutionError<'a> {
|
|||
/// error E0431: `self` import can only appear in an import list with a non-empty prefix
|
||||
SelfImportOnlyInImportListWithNonEmptyPrefix,
|
||||
/// error E0432: unresolved import
|
||||
UnresolvedImport(Option<(&'a str, Option<&'a str>)>),
|
||||
UnresolvedImport(Option<(&'a str, &'a str)>),
|
||||
/// error E0433: failed to resolve
|
||||
FailedToResolve(&'a str),
|
||||
/// 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
|
|||
}
|
||||
ResolutionError::UnresolvedImport(name) => {
|
||||
let msg = match name {
|
||||
Some((n, Some(p))) => format!("unresolved import `{}`{}", n, p),
|
||||
Some((n, None)) => format!("unresolved import (maybe you meant `{}::*`?)", n),
|
||||
Some((n, p)) => format!("unresolved import `{}`{}", n, p),
|
||||
None => "unresolved import".to_owned()
|
||||
};
|
||||
span_err!(resolver.session, span, E0432, "{}", msg);
|
||||
|
|
@ -1815,19 +1814,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
let imports = module_.imports.borrow();
|
||||
let import_count = imports.len();
|
||||
if index != import_count {
|
||||
let sn = self.session
|
||||
.codemap()
|
||||
.span_to_snippet((*imports)[index].span)
|
||||
.unwrap();
|
||||
if sn.contains("::") {
|
||||
resolve_error(self,
|
||||
(*imports)[index].span,
|
||||
ResolutionError::UnresolvedImport(None));
|
||||
} else {
|
||||
resolve_error(self,
|
||||
(*imports)[index].span,
|
||||
ResolutionError::UnresolvedImport(Some((&*sn, None))));
|
||||
}
|
||||
resolve_error(self,
|
||||
(*imports)[index].span,
|
||||
ResolutionError::UnresolvedImport(None));
|
||||
}
|
||||
|
||||
// Descend into children and anonymous children.
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
|
|||
Some((&*import_path_to_string(
|
||||
&import_directive.module_path,
|
||||
import_directive.subclass),
|
||||
Some(&*help))))
|
||||
&*help)))
|
||||
);
|
||||
}
|
||||
ResolveResult::Indeterminate => break, // Bail out. We'll come around next time.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue