-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Changed E0259 to new error format #35669
Conversation
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. |
☔ 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); |
There was a problem hiding this comment.
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"))
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Please fix the merge conflict and then I'll r+. |
@GuillaumeGomez everything should be good to go. |
Two things: please squash your commits and update the corresponding error code tests. |
Fixes #35514 as part of #35233.
r? @GuillaumeGomez