Skip to content

Private type error has poor span and inaccurate phrasing for private traits used as bounds #19062

Closed
@huonw

Description

@huonw
pub fn foo<T: Bar>() {}

trait Bar {}
priv-trait.rs:1:12: 1:13 error: private type in exported type parameter bound
priv-trait.rs:1 pub fn foo<T: Bar>() {}
                           ^
error: aborting due to previous error

The span should point to Bar (especially important for param lists with several traits), and it could probably say trait instead of type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions