Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
huonw opened this issue Nov 18, 2014 · 0 comments · Fixed by #19953
Closed
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@huonw
Copy link
Member

huonw commented Nov 18, 2014

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.

@huonw huonw added the A-diagnostics Area: Messages for errors, warnings, and lints label Nov 18, 2014
lnicola pushed a commit to lnicola/rust that referenced this issue Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant