-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bound for-deref types with Deref/DerefMut for better error messages #28
Conversation
This looks great, and thanks for the super fast turnaround on the implementation! I might be just blind, but I don't see a doctest anywhere in the codebase for custom deref types in autoimpl-on-trait. Would that be a useful addition? |
Good point about documenting explicit This diagnostic should work for
And wrong
Admittedly, the latter error may not be crystal clear, especially where #[autoimpl(Deref using self.0)]
struct MyGreatType<T: ?Sized>(Box<T>); Correct version: #[autoimpl(Deref<Target = T> using self.0)]
struct MyGreatType<T: ?Sized>(Box<T>); I should probably try adding tests involving the error message, but I'm too lazy. |
Implements #27. @nsunderland1 thoughts? (And thanks for the suggestions.)
TODO: changelog and release