Hi everyone, I'm trying to work on https://github.com/rust-lang/rust/issues/22750, trying to add a help message to the
the trait X is not implemented for MyStruct message if
MyStruct implements a trait
X from a different crate version.
I actually got that message working here, but I would very much like to show the expected and actual crate versions. I have no idea if that's even possible in rustc, I didn't find anything outside of rustdoc. Any suggestions?
It seems to me that you _could_ use
self.tcx.crate_hash(), but the result of that is not something that a user would necessarily be able to relate to anything. Making the error include the crate version would entail 1) adding an optional flag to
rustc to accept a crate version string and 2) make
cargo pass that flag in when compiling a crate.
Thanks again for the response! Okay, I think I'll probably first try to add some helpful diagnostics without including the crate version.