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

let_unit_value giving suggestion that fails to compile if implemented #2331

Closed
mhlakhani opened this issue Jan 6, 2018 · 1 comment
Closed

Comments

@mhlakhani
Copy link

In 1.23, FromIterator<()> for () was stabilized. I tried to write some new code to use this feature. As a simplified example I have the code in this playground:

https://play.rust-lang.org/?gist=3d3f6bde3183c079b072006ecf26b389&version=stable

Clippy will report the error on line 5. However if I remove the annotation and change it to this:

https://play.rust-lang.org/?gist=286a63d7f9e930265093ad211b5ddfc1&version=stable

I now get a compile error because the compiler doesn't know the return type.

Should clippy not warn in this case?

PS: This seemed different enough from #1502 that I filed a separate issue, feel free to merge.

@mhlakhani mhlakhani changed the title let_unit_value giving suggestion that fails to compile let_unit_value giving suggestion that fails to compile if implemented Jan 6, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Jan 8, 2018

Yea this is a dupe of #1502

commenting further there

@oli-obk oli-obk closed this as completed Jan 8, 2018
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

No branches or pull requests

2 participants