Skip to content

Conversation

EugeneGonzalez
Copy link

Fixes #35514 as part of #35233.

r? @GuillaumeGomez

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @GuillaumeGomez (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.

@bors
Copy link
Collaborator

bors commented Aug 15, 2016

☔ The latest upstream changes (presumably #35666) made this pull request unmergeable. Please resolve the merge conflicts.

@@ -3373,7 +3373,11 @@ impl<'a> Resolver<'a> {
};

let mut err = match (old_binding.is_extern_crate(), binding.is_extern_crate()) {
(true, true) => struct_span_err!(self.session, span, E0259, "{}", msg),
(true, true) => {
let mut e = struct_span_err!(self.session, span, E0259, "{}", msg);
Copy link
Member

Choose a reason for hiding this comment

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

Why not doing it in "one row"?

struct_span_err!(self.session, span, E0259, "{}", msg)
    .span_label(span, &format!("already imported"))

Copy link
Author

Choose a reason for hiding this comment

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

@GuillaumeGomez this is what I initial tried. The problem is that span_label returns a &mut of the expected match type. So unless we modified all the arms in the match to the oneliner so that it would match to the &mut TYPE, there would be a compiler error for the arm that used the oneliner. Seeing as almost all the arms in the bracket are switching to use the span_label, it shouldn't be a big problem to modify the entire match block.

Copy link
Member

Choose a reason for hiding this comment

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

Don't bother. It was just a small thing. Let's keep like this.

@GuillaumeGomez
Copy link
Member

Please fix the merge conflict and then I'll r+.

@EugeneGonzalez
Copy link
Author

@GuillaumeGomez everything should be good to go.

@GuillaumeGomez
Copy link
Member

Two things: please squash your commits and update the corresponding error code tests.

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