Closed
Description
I found two more cases when a pub use of a private item results in link-time errors.
lib.rs
pub use internal::core::{Trait, Struct};
mod internal
{
pub mod core
{
pub struct Struct;
impl Struct
{
pub fn init() -> Struct
{
Struct
}
}
pub trait Trait
{
fn test(&self)
{
private();
}
}
impl Trait for Struct {}
fn private()
{
}
}
}
test.rs
extern mod lib;
use lib::{Trait, Struct};
fn main()
{
Struct::init().test();
}
commands:
rustc --lib lib.rs
rustc test.rs -L.
Current output:
test.rc:(.text+0x3d): undefined reference to `internal::core::Struct::init::h168b469d58ae6141v5a1::v0.0'
test.o: In function `internal::core::Trait::test::h265f5d5a4f11b6da2::v0.0':
test.rc:(.text+0xf5): undefined reference to `internal::core::private::he344781a19bc4532aJ::v0.0'