{"action":"created","comment":{"url":"https://api.github.com/repos/diesel-rs/diesel/pulls/comments/66808203","id":66808203,"diff_hunk":"@@ -88,19 +88,20 @@ use helper_types::FindBy;\n /// assert_eq!(Err::<(i32, String), _>(NotFound), users.find(3).first(&connection));\n /// # }\n /// ```\n-pub trait FindDsl<PK> where\n-    Self: Table + FilterDsl<Eq<<Self as Table>::PrimaryKey, PK>>,\n-    PK: AsExpression<<Self::PrimaryKey as Expression>::SqlType>,\n-    Eq<Self::PrimaryKey, PK>: SelectableExpression<Self, SqlType=Bool> + NonAggregate,\n-{\n-    fn find(self, id: PK) -> FindBy<Self, Self::PrimaryKey, PK> {\n-        let primary_key = self.primary_key();\n-        self.filter(primary_key.eq(id))\n-    }\n+pub trait FindDsl<PK> {\n+    type Output: AsQuery;\n+\n+    fn find(self, id: PK) -> Self::Output;\n }\n \n impl<T, PK> FindDsl<PK> for T where\n     T: Table + FilterDsl<Eq<<T as Table>::PrimaryKey, PK>>,\n     PK: AsExpression<<T::PrimaryKey as Expression>::SqlType>,\n-    Eq<T::PrimaryKey, PK>: SelectableExpression<T, SqlType=Bool> + NonAggregate,\n-{}\n+{\n+    type Output = FindBy<Self, T::PrimaryKey, PK>;","path":"diesel/src/query_dsl/filter_dsl.rs","position":43,"original_position":43,"commit_id":"1693a6bd34ceb27e6c414a0e81638212f2009841","original_commit_id":"1693a6bd34ceb27e6c414a0e81638212f2009841","user":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars.githubusercontent.com/u/1529387?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"body":"No, that would expand to `type Output = <Self as FindDsl<PK>>::Output`, which would be infinitely recursive.","created_at":"2016-06-13T15:05:40Z","updated_at":"2016-06-13T15:05:40Z","html_url":"https://github.com/diesel-rs/diesel/pull/352#discussion_r66808203","pull_request_url":"https://api.github.com/repos/diesel-rs/diesel/pulls/352","_links":{"self":{"href":"https://api.github.com/repos/diesel-rs/diesel/pulls/comments/66808203"},"html":{"href":"https://github.com/diesel-rs/diesel/pull/352#discussion_r66808203"},"pull_request":{"href":"https://api.github.com/repos/diesel-rs/diesel/pulls/352"}}},"pull_request":{"url":"https://api.github.com/repos/diesel-rs/diesel/pulls/352","id":73577136,"html_url":"https://github.com/diesel-rs/diesel/pull/352","diff_url":"https://github.com/diesel-rs/diesel/pull/352.diff","patch_url":"https://github.com/diesel-rs/diesel/pull/352.patch","issue_url":"https://api.github.com/repos/diesel-rs/diesel/issues/352","number":352,"state":"open","locked":false,"title":"Move the trait bounds for `FindDsl` onto the impl","user":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars.githubusercontent.com/u/1529387?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"body":"Since Rust does not infer the where clasue of traits when using that\r\ntrait as a bound, you effectively have to restate the entire where\r\nclause every time you want to reference that trait. This makes `FindDsl`\r\nbasically impossible to actually abstract over in practice.\r\n\r\nThis promotes it to the same place that the rest of the query DSL is,\r\nwhere it has an abstract output and a helper type to follow the return\r\ntype chain through multiple levels.\r\n\r\nThis is part of a larger audit of this module to ensure consistency and\r\nease of abstraction throughout.","created_at":"2016-06-13T13:41:00Z","updated_at":"2016-06-13T15:05:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8da5825d61dbeded822527f739ef3784a55000c8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/diesel-rs/diesel/pulls/352/commits","review_comments_url":"https://api.github.com/repos/diesel-rs/diesel/pulls/352/comments","review_comment_url":"https://api.github.com/repos/diesel-rs/diesel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diesel-rs/diesel/issues/352/comments","statuses_url":"https://api.github.com/repos/diesel-rs/diesel/statuses/1693a6bd34ceb27e6c414a0e81638212f2009841","head":{"label":"diesel-rs:sg-reduce-trait-bounds","ref":"sg-reduce-trait-bounds","sha":"1693a6bd34ceb27e6c414a0e81638212f2009841","user":{"login":"diesel-rs","id":16763251,"avatar_url":"https://avatars.githubusercontent.com/u/16763251?v=3","gravatar_id":"","url":"https://api.github.com/users/diesel-rs","html_url":"https://github.com/diesel-rs","followers_url":"https://api.github.com/users/diesel-rs/followers","following_url":"https://api.github.com/users/diesel-rs/following{/other_user}","gists_url":"https://api.github.com/users/diesel-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/diesel-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diesel-rs/subscriptions","organizations_url":"https://api.github.com/users/diesel-rs/orgs","repos_url":"https://api.github.com/users/diesel-rs/repos","events_url":"https://api.github.com/users/diesel-rs/events{/privacy}","received_events_url":"https://api.github.com/users/diesel-rs/received_events","type":"Organization","site_admin":false},"repo":{"id":41609775,"name":"diesel","full_name":"diesel-rs/diesel","owner":{"login":"diesel-rs","id":16763251,"avatar_url":"https://avatars.githubusercontent.com/u/16763251?v=3","gravatar_id":"","url":"https://api.github.com/users/diesel-rs","html_url":"https://github.com/diesel-rs","followers_url":"https://api.github.com/users/diesel-rs/followers","following_url":"https://api.github.com/users/diesel-rs/following{/other_user}","gists_url":"https://api.github.com/users/diesel-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/diesel-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diesel-rs/subscriptions","organizations_url":"https://api.github.com/users/diesel-rs/orgs","repos_url":"https://api.github.com/users/diesel-rs/repos","events_url":"https://api.github.com/users/diesel-rs/events{/privacy}","received_events_url":"https://api.github.com/users/diesel-rs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diesel-rs/diesel","description":"A safe, extensible ORM and Query Builder for Rust","fork":false,"url":"https://api.github.com/repos/diesel-rs/diesel","forks_url":"https://api.github.com/repos/diesel-rs/diesel/forks","keys_url":"https://api.github.com/repos/diesel-rs/diesel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diesel-rs/diesel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diesel-rs/diesel/teams","hooks_url":"https://api.github.com/repos/diesel-rs/diesel/hooks","issue_events_url":"https://api.github.com/repos/diesel-rs/diesel/issues/events{/number}","events_url":"https://api.github.com/repos/diesel-rs/diesel/events","assignees_url":"https://api.github.com/repos/diesel-rs/diesel/assignees{/user}","branches_url":"https://api.github.com/repos/diesel-rs/diesel/branches{/branch}","tags_url":"https://api.github.com/repos/diesel-rs/diesel/tags","blobs_url":"https://api.github.com/repos/diesel-rs/diesel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diesel-rs/diesel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diesel-rs/diesel/git/refs{/sha}","trees_url":"https://api.github.com/repos/diesel-rs/diesel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diesel-rs/diesel/statuses/{sha}","languages_url":"https://api.github.com/repos/diesel-rs/diesel/languages","stargazers_url":"https://api.github.com/repos/diesel-rs/diesel/stargazers","contributors_url":"https://api.github.com/repos/diesel-rs/diesel/contributors","subscribers_url":"https://api.github.com/repos/diesel-rs/diesel/subscribers","subscription_url":"https://api.github.com/repos/diesel-rs/diesel/subscription","commits_url":"https://api.github.com/repos/diesel-rs/diesel/commits{/sha}","git_commits_url":"https://api.github.com/repos/diesel-rs/diesel/git/commits{/sha}","comments_url":"https://api.github.com/repos/diesel-rs/diesel/comments{/number}","issue_comment_url":"https://api.github.com/repos/diesel-rs/diesel/issues/comments{/number}","contents_url":"https://api.github.com/repos/diesel-rs/diesel/contents/{+path}","compare_url":"https://api.github.com/repos/diesel-rs/diesel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diesel-rs/diesel/merges","archive_url":"https://api.github.com/repos/diesel-rs/diesel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diesel-rs/diesel/downloads","issues_url":"https://api.github.com/repos/diesel-rs/diesel/issues{/number}","pulls_url":"https://api.github.com/repos/diesel-rs/diesel/pulls{/number}","milestones_url":"https://api.github.com/repos/diesel-rs/diesel/milestones{/number}","notifications_url":"https://api.github.com/repos/diesel-rs/diesel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diesel-rs/diesel/labels{/name}","releases_url":"https://api.github.com/repos/diesel-rs/diesel/releases{/id}","deployments_url":"https://api.github.com/repos/diesel-rs/diesel/deployments","created_at":"2015-08-29T22:51:00Z","updated_at":"2016-06-13T02:02:52Z","pushed_at":"2016-06-13T13:41:00Z","git_url":"git://github.com/diesel-rs/diesel.git","ssh_url":"git@github.com:diesel-rs/diesel.git","clone_url":"https://github.com/diesel-rs/diesel.git","svn_url":"https://github.com/diesel-rs/diesel","homepage":"","size":5449,"stargazers_count":934,"watchers_count":934,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":57,"mirror_url":null,"open_issues_count":48,"forks":57,"open_issues":48,"watchers":934,"default_branch":"master"}},"base":{"label":"diesel-rs:master","ref":"master","sha":"6be7a6cd7a59e6be09150479a9d37012a541a8b2","user":{"login":"diesel-rs","id":16763251,"avatar_url":"https://avatars.githubusercontent.com/u/16763251?v=3","gravatar_id":"","url":"https://api.github.com/users/diesel-rs","html_url":"https://github.com/diesel-rs","followers_url":"https://api.github.com/users/diesel-rs/followers","following_url":"https://api.github.com/users/diesel-rs/following{/other_user}","gists_url":"https://api.github.com/users/diesel-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/diesel-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diesel-rs/subscriptions","organizations_url":"https://api.github.com/users/diesel-rs/orgs","repos_url":"https://api.github.com/users/diesel-rs/repos","events_url":"https://api.github.com/users/diesel-rs/events{/privacy}","received_events_url":"https://api.github.com/users/diesel-rs/received_events","type":"Organization","site_admin":false},"repo":{"id":41609775,"name":"diesel","full_name":"diesel-rs/diesel","owner":{"login":"diesel-rs","id":16763251,"avatar_url":"https://avatars.githubusercontent.com/u/16763251?v=3","gravatar_id":"","url":"https://api.github.com/users/diesel-rs","html_url":"https://github.com/diesel-rs","followers_url":"https://api.github.com/users/diesel-rs/followers","following_url":"https://api.github.com/users/diesel-rs/following{/other_user}","gists_url":"https://api.github.com/users/diesel-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/diesel-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diesel-rs/subscriptions","organizations_url":"https://api.github.com/users/diesel-rs/orgs","repos_url":"https://api.github.com/users/diesel-rs/repos","events_url":"https://api.github.com/users/diesel-rs/events{/privacy}","received_events_url":"https://api.github.com/users/diesel-rs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diesel-rs/diesel","description":"A safe, extensible ORM and Query Builder for Rust","fork":false,"url":"https://api.github.com/repos/diesel-rs/diesel","forks_url":"https://api.github.com/repos/diesel-rs/diesel/forks","keys_url":"https://api.github.com/repos/diesel-rs/diesel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diesel-rs/diesel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diesel-rs/diesel/teams","hooks_url":"https://api.github.com/repos/diesel-rs/diesel/hooks","issue_events_url":"https://api.github.com/repos/diesel-rs/diesel/issues/events{/number}","events_url":"https://api.github.com/repos/diesel-rs/diesel/events","assignees_url":"https://api.github.com/repos/diesel-rs/diesel/assignees{/user}","branches_url":"https://api.github.com/repos/diesel-rs/diesel/branches{/branch}","tags_url":"https://api.github.com/repos/diesel-rs/diesel/tags","blobs_url":"https://api.github.com/repos/diesel-rs/diesel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diesel-rs/diesel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diesel-rs/diesel/git/refs{/sha}","trees_url":"https://api.github.com/repos/diesel-rs/diesel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diesel-rs/diesel/statuses/{sha}","languages_url":"https://api.github.com/repos/diesel-rs/diesel/languages","stargazers_url":"https://api.github.com/repos/diesel-rs/diesel/stargazers","contributors_url":"https://api.github.com/repos/diesel-rs/diesel/contributors","subscribers_url":"https://api.github.com/repos/diesel-rs/diesel/subscribers","subscription_url":"https://api.github.com/repos/diesel-rs/diesel/subscription","commits_url":"https://api.github.com/repos/diesel-rs/diesel/commits{/sha}","git_commits_url":"https://api.github.com/repos/diesel-rs/diesel/git/commits{/sha}","comments_url":"https://api.github.com/repos/diesel-rs/diesel/comments{/number}","issue_comment_url":"https://api.github.com/repos/diesel-rs/diesel/issues/comments{/number}","contents_url":"https://api.github.com/repos/diesel-rs/diesel/contents/{+path}","compare_url":"https://api.github.com/repos/diesel-rs/diesel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diesel-rs/diesel/merges","archive_url":"https://api.github.com/repos/diesel-rs/diesel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diesel-rs/diesel/downloads","issues_url":"https://api.github.com/repos/diesel-rs/diesel/issues{/number}","pulls_url":"https://api.github.com/repos/diesel-rs/diesel/pulls{/number}","milestones_url":"https://api.github.com/repos/diesel-rs/diesel/milestones{/number}","notifications_url":"https://api.github.com/repos/diesel-rs/diesel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diesel-rs/diesel/labels{/name}","releases_url":"https://api.github.com/repos/diesel-rs/diesel/releases{/id}","deployments_url":"https://api.github.com/repos/diesel-rs/diesel/deployments","created_at":"2015-08-29T22:51:00Z","updated_at":"2016-06-13T02:02:52Z","pushed_at":"2016-06-13T13:41:00Z","git_url":"git://github.com/diesel-rs/diesel.git","ssh_url":"git@github.com:diesel-rs/diesel.git","clone_url":"https://github.com/diesel-rs/diesel.git","svn_url":"https://github.com/diesel-rs/diesel","homepage":"","size":5449,"stargazers_count":934,"watchers_count":934,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":57,"mirror_url":null,"open_issues_count":48,"forks":57,"open_issues":48,"watchers":934,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/diesel-rs/diesel/pulls/352"},"html":{"href":"https://github.com/diesel-rs/diesel/pull/352"},"issue":{"href":"https://api.github.com/repos/diesel-rs/diesel/issues/352"},"comments":{"href":"https://api.github.com/repos/diesel-rs/diesel/issues/352/comments"},"review_comments":{"href":"https://api.github.com/repos/diesel-rs/diesel/pulls/352/comments"},"review_comment":{"href":"https://api.github.com/repos/diesel-rs/diesel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diesel-rs/diesel/pulls/352/commits"},"statuses":{"href":"https://api.github.com/repos/diesel-rs/diesel/statuses/1693a6bd34ceb27e6c414a0e81638212f2009841"}}}}
{"actor":{"display_login":"sgrif"}}