mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 06:47:34 +00:00
parent
89d04009c1
commit
6409f6bcf1
@ -2585,11 +2585,13 @@ impl Resolver {
|
|||||||
debug!("(resolving glob import) ... for value target");
|
debug!("(resolving glob import) ... for value target");
|
||||||
dest_import_resolution.value_target =
|
dest_import_resolution.value_target =
|
||||||
Some(Target(containing_module, name_bindings));
|
Some(Target(containing_module, name_bindings));
|
||||||
|
dest_import_resolution.value_id = id;
|
||||||
}
|
}
|
||||||
if name_bindings.defined_in_public_namespace(TypeNS) {
|
if name_bindings.defined_in_public_namespace(TypeNS) {
|
||||||
debug!("(resolving glob import) ... for type target");
|
debug!("(resolving glob import) ... for type target");
|
||||||
dest_import_resolution.type_target =
|
dest_import_resolution.type_target =
|
||||||
Some(Target(containing_module, name_bindings));
|
Some(Target(containing_module, name_bindings));
|
||||||
|
dest_import_resolution.type_id = id;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
84
src/test/compile-fail/lint-unused-import-tricky-globs.rs
Normal file
84
src/test/compile-fail/lint-unused-import-tricky-globs.rs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user