{"action":"created","issue":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/737","repository_url":"https://api.github.com/repos/Manishearth/rust-clippy","labels_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/737/labels{/name}","comments_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/737/comments","events_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/737/events","html_url":"https://github.com/Manishearth/rust-clippy/pull/737","id":138273175,"number":737,"title":"Warn about calling a closure in the same expression where it's defined.","user":{"login":"martiansideofthemoon","id":8805240,"avatar_url":"https://avatars.githubusercontent.com/u/8805240?v=3","gravatar_id":"","url":"https://api.github.com/users/martiansideofthemoon","html_url":"https://github.com/martiansideofthemoon","followers_url":"https://api.github.com/users/martiansideofthemoon/followers","following_url":"https://api.github.com/users/martiansideofthemoon/following{/other_user}","gists_url":"https://api.github.com/users/martiansideofthemoon/gists{/gist_id}","starred_url":"https://api.github.com/users/martiansideofthemoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martiansideofthemoon/subscriptions","organizations_url":"https://api.github.com/users/martiansideofthemoon/orgs","repos_url":"https://api.github.com/users/martiansideofthemoon/repos","events_url":"https://api.github.com/users/martiansideofthemoon/events{/privacy}","received_events_url":"https://api.github.com/users/martiansideofthemoon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-03T19:23:19Z","updated_at":"2016-03-03T19:52:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/pulls/737","html_url":"https://github.com/Manishearth/rust-clippy/pull/737","diff_url":"https://github.com/Manishearth/rust-clippy/pull/737.diff","patch_url":"https://github.com/Manishearth/rust-clippy/pull/737.patch"},"body":"Tries to solve #476 \r\nSo I've done a bit of work following the blog and `CONTRIBUTING.md`. I managed to print the AST node tree of my test file to be [url](https://pastebin.mozilla.org/8862081). The really nested part seems to be the interesting part containing the variants \"Paren\", \"Closure\", \"Literal\" and basically everything I'm interested in. Could someone give tell me about the `struct` I should `if let` my `expr.node` with? Would [`TyKind::Parent`](http://manishearth.github.io/rust-internals-docs/syntax/ast/enum.TyKind.html#variant.Paren) be relevant? @Manishearth @mcarton "},"comment":{"url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/comments/191933928","html_url":"https://github.com/Manishearth/rust-clippy/pull/737#issuecomment-191933928","issue_url":"https://api.github.com/repos/Manishearth/rust-clippy/issues/737","id":191933928,"user":{"login":"mcarton","id":3751788,"avatar_url":"https://avatars.githubusercontent.com/u/3751788?v=3","gravatar_id":"","url":"https://api.github.com/users/mcarton","html_url":"https://github.com/mcarton","followers_url":"https://api.github.com/users/mcarton/followers","following_url":"https://api.github.com/users/mcarton/following{/other_user}","gists_url":"https://api.github.com/users/mcarton/gists{/gist_id}","starred_url":"https://api.github.com/users/mcarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcarton/subscriptions","organizations_url":"https://api.github.com/users/mcarton/orgs","repos_url":"https://api.github.com/users/mcarton/repos","events_url":"https://api.github.com/users/mcarton/events{/privacy}","received_events_url":"https://api.github.com/users/mcarton/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T19:52:08Z","updated_at":"2016-03-03T19:52:08Z","body":"`(|| 42)()` would be an `ExprKind::Call`. `TyKind::*` are for types AST node (eg. the `Vec<Foo>` in `let foo: Vec<Foo> = …;`) and Clippy never gets `FooKind::Paren`, those are cleaned out by rustc before the lints passes are called (which makes it much more easier to match the AST, otherwise we’d have to assume anything can be parenthesized)."}}