Skip to content
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

Errors with Generics - missing trait bounds. #112

Closed
drahnr opened this issue Nov 30, 2020 · 2 comments
Closed

Errors with Generics - missing trait bounds. #112

drahnr opened this issue Nov 30, 2020 · 2 comments

Comments

@drahnr
Copy link

drahnr commented Nov 30, 2020

During cleaning up some of the error handling in paritytech/substrate I encountered that using #[error("yada {0:?}")] for something along the lines of struct Erroris<T>(pub Wrapper<T>) does not enforce a T: Debug bound on the underlying generic type, but requires adding a bound on the struct declaration/definition rather than the generated fmt::Debug impl. That goes against what is stated as a best practice in the future proofing guide https://rust-lang.github.io/api-guidelines/future-proofing.html?#data-structures-do-not-duplicate-derived-trait-bounds-c-struct-bounds .

paritytech/substrate#7631 (comment)

It would be awesome if this could be addressed ❤️

@bkchr
Copy link

bkchr commented Nov 30, 2020

Probably a duplicate of: #79

@dtolnay
Copy link
Owner

dtolnay commented May 22, 2021

Yeah this is tracked in #79, and is just waiting on a PR.

@dtolnay dtolnay closed this as completed May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants