mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-30 16:43:41 +00:00
resolve: Make "empty import canaries" invisible from other crates
This commit is contained in:
parent
f1e2fa8f04
commit
1e4cf740cf
@ -1164,7 +1164,10 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
|
||||
None => continue,
|
||||
};
|
||||
|
||||
if binding.is_import() || binding.is_macro_def() {
|
||||
// Filter away "empty import canaries".
|
||||
let is_non_canary_import =
|
||||
binding.is_import() && binding.vis != ty::Visibility::Invisible;
|
||||
if is_non_canary_import || binding.is_macro_def() {
|
||||
let def = binding.def();
|
||||
if def != Def::Err {
|
||||
if let Some(def_id) = def.opt_def_id() {
|
||||
|
5
src/test/ui/imports/auxiliary/issue-55811.rs
Normal file
5
src/test/ui/imports/auxiliary/issue-55811.rs
Normal file
@ -0,0 +1,5 @@
|
||||
mod m {}
|
||||
|
||||
// These two imports should not conflict when this crate is loaded from some other crate.
|
||||
use m::{};
|
||||
use m::{};
|
6
src/test/ui/imports/issue-55811.rs
Normal file
6
src/test/ui/imports/issue-55811.rs
Normal file
@ -0,0 +1,6 @@
|
||||
// compile-pass
|
||||
// aux-build:issue-55811.rs
|
||||
|
||||
extern crate issue_55811;
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user