Auto merge of #31648 - jseyfried:fix_diagnostics, r=nrc

This PR fixes two unrelated diagnostics bugs in resolve.

First, it reports privacy errors for an import only after the import resolution is determined, fixing #31402.

Second, it expands the per-module map from block ids to anonymous modules so that it also maps module declarations ids to modules, and it uses this map to in `with_scope` to fix #31644.

r? @nrc
This commit is contained in:
bors 2016-02-15 07:13:02 +00:00
commit 4ce803837e
4 changed files with 44 additions and 93 deletions

View file

@ -8,12 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
mod Foo {
pub static X: isize = 42;
}
enum Foo { //~ ERROR duplicate definition of type or module `Foo`
enum Foo {
X
}
mod Foo { //~ ERROR duplicate definition of type or module `Foo`
pub static X: isize = 42;
fn f() { f() } // Check that this does not result in a resolution error
}
fn main() {}