Correct the sources of glob imports

Closes #8847
This commit is contained in:
Alex Crichton 2013-08-29 19:48:37 -07:00
parent 89d04009c1
commit 6409f6bcf1
2 changed files with 86 additions and 0 deletions

View File

@ -2585,11 +2585,13 @@ impl Resolver {
debug!("(resolving glob import) ... for value target");
dest_import_resolution.value_target =
Some(Target(containing_module, name_bindings));
dest_import_resolution.value_id = id;
}
if name_bindings.defined_in_public_namespace(TypeNS) {
debug!("(resolving glob import) ... for type target");
dest_import_resolution.type_target =
Some(Target(containing_module, name_bindings));
dest_import_resolution.type_id = id;
}
};

View File

@ -0,0 +1,84 @@
// Copyright 2013 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 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deny(unused_imports)];
mod A {
pub fn p() {}
}
mod B {
pub fn p() {}
}
mod C {
pub fn q() {}
}
mod D {
pub fn q() {}
}
mod E {
pub fn r() {}
}
mod F {
pub fn r() {}
}
mod G {
pub fn s() {}
pub fn t() {}
}
mod H {
pub fn s() {}
}
mod I {
pub fn u() {}
pub fn v() {}
}
mod J {
pub fn u() {}
pub fn v() {}
}
mod K {
pub fn w() {}
}
mod L {
pub fn w() {}
}
mod m {
use A::p; //~ ERROR: unused import
use B::p;
use C::q; //~ ERROR: unused import
use D::*;
use E::*; //~ ERROR: unused import
use F::r;
use G::*;
use H::*;
use I::*;
use J::v;
use K::*; //~ ERROR: unused import
use L::*;
#[main]
fn my_main() {
p();
q();
r();
s();
t();
u();
v();
w();
}
}