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

Update E0463 error message to new format #36060

Merged
merged 1 commit into from
Aug 30, 2016

Conversation

paulfanelli
Copy link
Contributor

Fixes #35934 as part of #35233

r? @jonathandturner

@rust-highfive
Copy link
Collaborator

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.

@@ -342,6 +343,7 @@ impl<'a> Context<'a> {
"found crate `{}` compiled by an incompatible version of rustc{}",
self.ident, add)
} else {
err_msg = format!("can't find crate");
struct_span_err!(self.sess, self.span, E0463,
"can't find crate for `{}`{}",
self.ident, add)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sophiajt
Copy link
Contributor

@paulfanelli - looks close. I added a comment of a way to tighten up the code.

@paulfanelli
Copy link
Contributor Author

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.

@paulfanelli
Copy link
Contributor Author

I've updated the PR...

@sophiajt
Copy link
Contributor

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.

@paulfanelli
Copy link
Contributor Author

Ok, I've squashed them together...and updated this PR.

@sophiajt
Copy link
Contributor

Great, thanks.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 29, 2016

📌 Commit 58ced16 has been approved by jonathandturner

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 29, 2016
… r=jonathandturner

Update E0463 error message to new format

Fixes rust-lang#35934 as part of rust-lang#35233

r? @jonathandturner
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 30, 2016
… r=jonathandturner

Update E0463 error message to new format

Fixes rust-lang#35934 as part of rust-lang#35233

r? @jonathandturner
bors added a commit that referenced this pull request Aug 30, 2016
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 30, 2016
… r=jonathandturner

Update E0463 error message to new format

Fixes rust-lang#35934 as part of rust-lang#35233

r? @jonathandturner
bors added a commit that referenced this pull request Aug 30, 2016
@bors bors merged commit 58ced16 into rust-lang:master Aug 30, 2016
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

Successfully merging this pull request may close these issues.

4 participants