resolve: Make "empty import canaries" invisible from other crates

This commit is contained in:
Vadim Petrochenkov 2018-11-21 03:39:41 +03:00
parent f1e2fa8f04
commit 1e4cf740cf
3 changed files with 15 additions and 1 deletions

View File

@ -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() {

View 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::{};

View File

@ -0,0 +1,6 @@
// compile-pass
// aux-build:issue-55811.rs
extern crate issue_55811;
fn main() {}