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

Regression in return type error quality with impl trait #50652

jonathandturner opened this Issue May 11, 2018 · 2 comments


None yet
4 participants
Copy link

jonathandturner commented May 11, 2018

In playing with impl trait this morning, I noticed that if you do the classic "oops, I left a ; after my return value" error, instead of the helpful message asking if you meant to have the semi-colon, you get this:

screen shot 2018-05-11 at 5 20 58 am

We should definitely try to cover this case too with the same improved error messages we have for other return types.


This comment has been minimized.

Copy link
Contributor Author

jonathandturner commented May 11, 2018

Test case

trait Bar {}
impl Bar for bool {}

fn baz() -> impl Bar {

fn main() {

This comment has been minimized.

Copy link

larsluthman commented May 12, 2018

The same error message appears if your function body consists of 'unimplemented!()' or 'panic!()'. In that case it should probably say something like 'Failed to infer return type' instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment