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

Fixing eta with respect to lazy evaluation. #4190

Merged
merged 2 commits into from
Jun 10, 2019
Merged

Conversation

projedi
Copy link
Contributor

@projedi projedi commented Jun 10, 2019

This fixes #4187

changelog: redundant_closure: stop linting on expressions returning a function, which is then directly used by the closure

@projedi projedi changed the title Fixing eta with respect to lazy evaluation. Closes #4187 Fixing eta with respect to lazy evaluation. Jun 10, 2019
@llogiq
Copy link
Contributor

llogiq commented Jun 10, 2019

Oops. I did not see you were working on this and did (mostly) the same thing.

@projedi
Copy link
Contributor Author

projedi commented Jun 10, 2019

Oops. I did not see you were working on this and did (mostly) the same thing.

Oh, I didn't notice that you did it too. Well, I don't mind whose PR gets merged in, as long as the problem is fixed. I can close this one, if you like.

@flip1995
Copy link
Member

Travis failure looks like a bug in rustfmt to me 🤔

-fn make_lazy(f: fn() -> fn(u8) -> u8) -> impl Fn(u8) -> u8 {
+fn make_lazy(f: fn() -> fn(u8) -> fn(u8) -> u8) -> impl Fn(u8) -> u8 {

@projedi
Copy link
Contributor Author

projedi commented Jun 10, 2019

Travis failure looks like a bug in rustfmt to me 🤔

-fn make_lazy(f: fn() -> fn(u8) -> u8) -> impl Fn(u8) -> u8 {
+fn make_lazy(f: fn() -> fn(u8) -> fn(u8) -> u8) -> impl Fn(u8) -> u8 {

I think you're right, opened rust-lang/rustfmt#3615 to track it. There's a workaround, though: changing type of f to impl Fn() -> fn(u8) -> u8.

@flip1995
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jun 10, 2019

📌 Commit 41a4ce5 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Jun 10, 2019

⌛ Testing commit 41a4ce5 with merge ba1702a...

bors added a commit that referenced this pull request Jun 10, 2019
Fixing eta with respect to lazy evaluation.

This fixes #4187

changelog: `redundant_closure`: stop linting on expressions returning a function, which is then directly used by the closure
@bors
Copy link
Contributor

bors commented Jun 10, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing ba1702a to master...

@bors bors merged commit 41a4ce5 into rust-lang:master Jun 10, 2019
@projedi projedi deleted the fix-eta branch June 11, 2019 05:48
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.

clippy::redundant_closure false positive: laziness
4 participants