Skip to content

Trait re-exports fail due to privacy of containing module #18241

Closed
@Ryman

Description

@Ryman

This was working previously before rustc 0.13.0-nightly (3d2cf6063 2014-10-22 00:22:04 +0000).

If this is an intended change, we should probably give the error where the re-export is defined and not on use of the trait.

use foo::Bar;

mod foo {
    pub use self::bar::Bar;

    mod bar {
        pub trait Bar {
            fn call(&self) -> bool;
        }
    }
}

impl foo::Bar for uint {
    fn call(&self) -> bool {
        true
    }
}

fn main() {
    println!("{}", 0u.call())
    //^~ ERROR source trait is inaccessible
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyA-trait-systemArea: Trait system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions