提交 6807349e 编写于 作者: K Kiet Tran 提交者: Alex Crichton

privacy: Add publically-reexported foreign item to exported item set

Close #15740
上级 2daa0970
......@@ -325,7 +325,7 @@ fn visit_item(&mut self, item: &ast::Item, _: ()) {
}
fn visit_foreign_item(&mut self, a: &ast::ForeignItem, _: ()) {
if self.prev_exported && a.vis == ast::Public {
if (self.prev_exported && a.vis == ast::Public) || self.reexports.contains(&a.id) {
self.exported_items.insert(a.id);
}
}
......
......@@ -16,6 +16,11 @@
extern crate libc;
pub use x = extern_foo;
extern {
fn extern_foo();
}
struct Foo; //~ ERROR: code is never used
impl Foo {
fn foo(&self) { //~ ERROR: code is never used
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册