Update E0463 error message to new format#36060
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jonathandturner (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
src/librustc_metadata/loader.rs
Outdated
There was a problem hiding this comment.
Rather than setting err_msg and using it later, you could instead set the label in the same condition. Maybe something like:
let mut err = struct_span_err!(self.sess, self.span, E0463,
"can't find crate for `{}`{}",
self.ident, add);
err.span_label(self.span, &format!("can't find crate"));
err|
@paulfanelli - looks close. I added a comment of a way to tighten up the code. |
|
Oh man, I originally tried to code it that way, but I made a mistake, got a compiler error (it said there was a type mismatch between the if and else blocks) and thought that I couldn't code it that way. I tried your change -- and it works! Very nice. Definitely, learned a bunch of stuff from this one. Thx. |
|
I've updated the PR... |
36fc4b6 to
1b15ba3
Compare
|
Yeah, that looks a lot better. I think we're almost there. One last thing - can you squash your two commits down to one? With that I think we're ready. |
1b15ba3 to
58ced16
Compare
|
Ok, I've squashed them together...and updated this PR. |
|
Great, thanks. @bors r+ rollup |
|
📌 Commit 58ced16 has been approved by |
… r=jonathandturner Update E0463 error message to new format Fixes rust-lang#35934 as part of rust-lang#35233 r? @jonathandturner
… r=jonathandturner Update E0463 error message to new format Fixes rust-lang#35934 as part of rust-lang#35233 r? @jonathandturner
… r=jonathandturner Update E0463 error message to new format Fixes rust-lang#35934 as part of rust-lang#35233 r? @jonathandturner
Fixes #35934 as part of #35233
r? @jonathandturner