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

Additional span info for E0053 #35765

Merged
merged 3 commits into from Aug 18, 2016
Merged

Additional span info for E0053 #35765

merged 3 commits into from Aug 18, 2016

Conversation

KiChjang
Copy link
Member

Part of #35233.
Fixes #35212.

r? @jonathandturner

@@ -144,8 +144,7 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
found bound lifetime parameter {}", br)
}
Sorts(values) => ty::tls::with(|tcx| {
report_maybe_different(f, values.expected.sort_string(tcx),
values.found.sort_string(tcx))
write!(f, "expected {}", values.expected.sort_string(tcx))
Copy link
Member Author

Choose a reason for hiding this comment

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

The reason why there are so many test expectation changes is due to this line here. I realize that changing this here means that all affected error messages will have to be shown in the new format, and I haven't really touched the other ones aside from E0053.

Copy link
Contributor

Choose a reason for hiding this comment

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

I know you just did all the work to change this, but this part of the change makes me nervous. If there are other errors that will also need "expected __, found ___" changes for the label, maybe it makes sense to do all of those at once.

What does this change look like without changing this line?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking through the unit tests that changed, I think I definitely underestimated the impact changing the label would have.

For the time being it looks like we'll need to keep it as-is, until we can come up with another solution. If we removed the "expected" part, some of the labels just won't make sense or will become much more difficult to understand.

Copy link
Member Author

@KiChjang KiChjang Aug 17, 2016

Choose a reason for hiding this comment

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

That's totally fine (in fact, that's the whole reason why I have a separate commit removing all the "found ___" part). It does make me feel like it makes more sense to change all of them at once. Not sure if this interim state is desirable though, i.e. having the span label say "expected ___, found ____" instead of simply "expected ____".

@@ -24,20 +24,20 @@ fn main() {
//~^ ERROR mismatched types
//~| expected type `fn(isize) -> isize {foo::<u8>}`
//~| found type `fn(isize) -> isize {bar::<u8>}`
//~| expected fn item, found a different fn item
//~| expected fn item
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, changes like this in particular are what I was worried about. If we remove the found part the underline becomes very confusing.

@KiChjang
Copy link
Member Author

Okay, I've removed the test expectation changes and the code is now using the older format of "expected ___, found ___".

@sophiajt
Copy link
Contributor

Great! Thanks for doing that.

@bors r+

@bors
Copy link
Contributor

bors commented Aug 17, 2016

📌 Commit 7aef7e4 has been approved by jonathandturner

@KiChjang
Copy link
Member Author

I needed to re-update my UI test. re-r? @jonathandturner

@sophiajt
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 17, 2016

📌 Commit 31d56cb has been approved by jonathandturner

eddyb added a commit to eddyb/rust that referenced this pull request Aug 18, 2016
@bors bors merged commit 31d56cb into rust-lang:master Aug 18, 2016
@KiChjang KiChjang deleted the e0053-bonus branch August 18, 2016 19:22
let arg_idx = impl_iter.zip(trait_iter)
.position(|(impl_arg_ty, trait_arg_ty)| {
*impl_arg_ty == found && *trait_arg_ty == expected
}).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

This unwrap is probably the cause of the ICE / regression #35869.

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.

None yet

4 participants