2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2018-08-31 13:02:01 +00:00
|
|
|
#![allow(non_snake_case)]
|
|
|
|
|
2014-02-11 19:19:18 +00:00
|
|
|
|
|
|
|
// Check we do the correct privacy checks when we import a name and there is an
|
|
|
|
// item with that name in both the value and type namespaces.
|
|
|
|
|
2015-03-22 20:13:15 +00:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2014-04-14 15:30:31 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_imports)]
|
2014-02-11 19:19:18 +00:00
|
|
|
|
2014-05-06 01:56:44 +00:00
|
|
|
|
2014-02-11 19:19:18 +00:00
|
|
|
// public type, private value
|
|
|
|
pub mod foo1 {
|
|
|
|
pub trait Bar {
|
2015-02-12 15:29:52 +00:00
|
|
|
fn dummy(&self) { }
|
2014-02-11 19:19:18 +00:00
|
|
|
}
|
|
|
|
pub struct Baz;
|
|
|
|
|
|
|
|
fn Bar() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_unused1() {
|
|
|
|
use foo1::*;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_single1() {
|
|
|
|
use foo1::Bar;
|
|
|
|
|
2019-05-28 18:47:21 +00:00
|
|
|
let _x: Box<dyn Bar>;
|
2014-02-11 19:19:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn test_list1() {
|
|
|
|
use foo1::{Bar,Baz};
|
|
|
|
|
2019-05-28 18:47:21 +00:00
|
|
|
let _x: Box<dyn Bar>;
|
2014-02-11 19:19:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn test_glob1() {
|
|
|
|
use foo1::*;
|
|
|
|
|
2019-05-28 18:47:21 +00:00
|
|
|
let _x: Box<dyn Bar>;
|
2014-02-11 19:19:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// private type, public value
|
|
|
|
pub mod foo2 {
|
|
|
|
trait Bar {
|
2015-02-12 15:29:52 +00:00
|
|
|
fn dummy(&self) { }
|
2014-02-11 19:19:18 +00:00
|
|
|
}
|
|
|
|
pub struct Baz;
|
|
|
|
|
|
|
|
pub fn Bar() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_unused2() {
|
|
|
|
use foo2::*;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_single2() {
|
|
|
|
use foo2::Bar;
|
|
|
|
|
|
|
|
Bar();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_list2() {
|
|
|
|
use foo2::{Bar,Baz};
|
|
|
|
|
|
|
|
Bar();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_glob2() {
|
|
|
|
use foo2::*;
|
|
|
|
|
|
|
|
Bar();
|
|
|
|
}
|
|
|
|
|
|
|
|
// public type, public value
|
|
|
|
pub mod foo3 {
|
|
|
|
pub trait Bar {
|
2015-02-12 15:29:52 +00:00
|
|
|
fn dummy(&self) { }
|
2014-02-11 19:19:18 +00:00
|
|
|
}
|
|
|
|
pub struct Baz;
|
|
|
|
|
|
|
|
pub fn Bar() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_unused3() {
|
|
|
|
use foo3::*;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test_single3() {
|
|
|
|
use foo3::Bar;
|
|
|
|
|
|
|
|
Bar();
|
2019-05-28 18:47:21 +00:00
|
|
|
let _x: Box<dyn Bar>;
|
2014-02-11 19:19:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn test_list3() {
|
|
|
|
use foo3::{Bar,Baz};
|
|
|
|
|
|
|
|
Bar();
|
2019-05-28 18:47:21 +00:00
|
|
|
let _x: Box<dyn Bar>;
|
2014-02-11 19:19:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn test_glob3() {
|
|
|
|
use foo3::*;
|
|
|
|
|
|
|
|
Bar();
|
2019-05-28 18:47:21 +00:00
|
|
|
let _x: Box<dyn Bar>;
|
2014-02-11 19:19:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|