diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 6b519fa7b83b..18e815e9b7c0 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -146,7 +146,7 @@ pub use types::os::arch::c95::{c_ushort, clock_t, ptrdiff_t}; pub use types::os::arch::c95::{size_t, time_t}; pub use types::os::arch::c99::{c_longlong, c_ulonglong, intptr_t}; pub use types::os::arch::c99::{uintptr_t}; -pub use types::os::arch::posix88::{dev_t, dirent_t, ino_t, mode_t}; +pub use types::os::arch::posix88::{dev_t, ino_t, mode_t}; pub use types::os::arch::posix88::{off_t, pid_t, ssize_t}; pub use consts::os::c95::{_IOFBF, _IOLBF, _IONBF, BUFSIZ, EOF}; diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index cfacf0ee3df9..8240068979cb 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -144,6 +144,12 @@ impl NamespaceResult { _ => false } } + fn is_unbound(&self) -> bool { + match *self { + UnboundResult => true, + _ => false + } + } } enum NameDefinition { @@ -2449,8 +2455,7 @@ impl<'a> Resolver<'a> { } } - if import_resolution.value_target.borrow().is_none() && - import_resolution.type_target.borrow().is_none() { + if value_result.is_unbound() && type_result.is_unbound() { let msg = format!("unresolved import: there is no \ `{}` in `{}`", token::get_ident(source), diff --git a/src/test/compile-fail/issue-13404.rs b/src/test/compile-fail/issue-13404.rs new file mode 100644 index 000000000000..2ce502ee8dbb --- /dev/null +++ b/src/test/compile-fail/issue-13404.rs @@ -0,0 +1,21 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use a::f; +use b::f; +//~^ ERROR: unresolved import +//~^^ ERROR: failed to resolve import + +mod a { pub fn f() {} } +mod b { } + +fn main() { + f(); +}