Skip to content

"Private trait in exported type parameter bound" #20148

@tbu-

Description

@tbu-
trait Trait { }
impl Trait for () { }
impl Trait for ((),) { }

pub fn function<K:Trait>() {
}

pub struct Struct<K:Trait>;

fn main() { }

Errors:

a.rs:5:19: 5:24 error: private trait in exported type parameter bound
a.rs:5 pub fn function<K:Trait>() {
                         ^~~~~
a.rs:8:21: 8:26 error: private trait in exported type parameter bound
a.rs:8 pub struct Struct<K:Trait>;
                           ^~~~~

This stops me from providing a trait that is an implementation detail and as such should not be exported (it could change anytime, no backwards-compatiblity at all).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions