-
Notifications
You must be signed in to change notification settings - Fork 26
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
Poor error suggestion from failure to use
trait
#44
Comments
This should be filed as a compiler bug -- One way you can get around this is explicitly naming the crate (#35),
This may also be a compiler issue, but I'm less sure that anything can be changed here. Whether that's a |
Ok, thanks, I'll try to remember to pass it along as a compiler bug shortly, very busy just at the moment though. :) |
This is probably an issue best suited for rustc itself rather than this crate, but I wanted to start here in case there's anything to be done for your crate to improve things...
I'm just now implementing use of this crate in one of mine (thanks btw!), and I forgot initially to add a
use num_traits::FromPrimitive;
line in the file, since the instructions for this crate failed to remind me of the need :pThe error message that resulted (using rustc v1.47) was:
That
use
suggestion is obviously not the most helpful.It is similar to what was noticed in issue #27, though it that case it was referencing an external crate. Here it's referencing... well, I guess something generated by the macros via the derive... within my own crate... though for a completely different module than the one containing the type I'm calling the method on (crate::def::PortAvailable). I have derived the trait on multiple enums throughout the crate, including within the
channelmap
module, and interestingly I think that module comes first alphabetically...It's also not ideal that it's referencing
capi::pa_port_available_t
as the type the method is not found for, which is the original type from the 'sys' crate (aliased ascapi
) which this binding crate is re-exporting asdef::PortAvailable
. Which brings up the point that for this type, the derive is actually applied to it within the 'sys' crate, if that detail is at all important.The text was updated successfully, but these errors were encountered: