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

Fold E0612, E0613 into E0609 #42996

Merged
merged 1 commit into from
Jul 8, 2017
Merged

Conversation

strangeglyph
Copy link
Contributor

As discussed in #42945, with PR 1506 tuple indices are no longer considered a separate case from normal field. This PR folds E06012 ("tuple index out of bounds") and E0613 ("type is not a tuple") into E0609 ("type does not have field with that name")

Resolves #42945

@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 @pnkfelix (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.

@strangeglyph
Copy link
Contributor Author

My apologies, I forgot to run the full test suite and apparently missed something.

@strangeglyph
Copy link
Contributor Author

All tests pass now on my end

@Mark-Simulacrum Mark-Simulacrum added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 2, 2017
@Mark-Simulacrum
Copy link
Member

Thanks for the pull request! We'll get @pnkfelix or someone else from the compiler team to review this soon.

cc @GuillaumeGomez -- perhaps you'd like to take a look since I believe you created some of these in the first place?

@@ -3057,20 +3057,18 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
return field_ty;
}

if tuple_like {
type_error_struct!(self.tcx().sess, expr.span, expr_t, E0612,
Copy link
Member

@GuillaumeGomez GuillaumeGomez Jul 2, 2017

Choose a reason for hiding this comment

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

I feel like this error is a bit different than the others. Not sure if this is a good idea to merge it as well... To be more precise: the others refer to non-existing fields whereas this one is about accessing a out-of-bound value (so it kind of exist).

Copy link
Member

@GuillaumeGomez GuillaumeGomez left a comment

Choose a reason for hiding this comment

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

I really think we should keep E0612 on its own and not merge it with others.

self.tcx().types.err
}

fn no_such_field_err<T: Display>(&self, span: Span, field: T, expr_t: &ty::TyS)
-> DiagnosticBuilder {

Copy link
Member

Choose a reason for hiding this comment

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

Extra empty line.

println!("x: {} y: {}", s.x, s.y);
```
"##,
// E0612: Removed (merged with E0609)
Copy link
Member

Choose a reason for hiding this comment

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

Please put them into the error code list at the bottom.

@@ -12,5 +12,5 @@ const TUP: (usize,) = (42,);

fn main() {
let a: [isize; TUP.1];
//~^ ERROR attempted out-of-bounds tuple index
//~^ ERROR no field `1` on type `(usize,)`
Copy link
Member

Choose a reason for hiding this comment

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

This error is clearly less good from my point of view. Before it was very clear but now, seems more confusing.

@strangeglyph
Copy link
Contributor Author

@GuillaumeGomez Alright, reverted the changes to E0612

@GuillaumeGomez
Copy link
Member

Thanks! Please squash your commits and then it's good for me.

@alexcrichton
Copy link
Member

ping @GuillaumeGomez, looks like this has been updated and is ready for a re-review?

@GuillaumeGomez
Copy link
Member

The review was done, I was waiting for the squash. Since it's done, we can r+. Thanks @Boreeas!

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 6, 2017

📌 Commit d7ebc61 has been approved by GuillaumeGomez

@strangeglyph
Copy link
Contributor Author

No problem! My apologies for not sending a notice that I squashed

@bors
Copy link
Contributor

bors commented Jul 7, 2017

🔒 Merge conflict

@strangeglyph
Copy link
Contributor Author

Rebased the PR

@GuillaumeGomez
Copy link
Member

Then here we go again!

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 8, 2017

📌 Commit c215d08 has been approved by GuillaumeGomez

@bors
Copy link
Contributor

bors commented Jul 8, 2017

⌛ Testing commit c215d08 with merge 1e5162c...

bors added a commit that referenced this pull request Jul 8, 2017
Fold E0612, E0613 into E0609

As discussed in #42945, with PR 1506 tuple indices are no longer considered a separate case from normal field. This PR folds E06012 ("tuple index out of bounds") and E0613 ("type is not a tuple") into E0609 ("type does not have field with that name")

Resolves #42945
@bors
Copy link
Contributor

bors commented Jul 8, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: GuillaumeGomez
Pushing 1e5162c to master...

@bors bors merged commit c215d08 into rust-lang:master Jul 8, 2017
@bors bors mentioned this pull request Jul 8, 2017
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants