{"action":"opened","number":562,"pull_request":{"url":"https://api.github.com/repos/gfx-rs/gfx-rs/pulls/562","id":29316368,"html_url":"https://github.com/gfx-rs/gfx-rs/pull/562","diff_url":"https://github.com/gfx-rs/gfx-rs/pull/562.diff","patch_url":"https://github.com/gfx-rs/gfx-rs/pull/562.patch","issue_url":"https://api.github.com/repos/gfx-rs/gfx-rs/issues/562","number":562,"state":"open","locked":false,"title":"[WIP] Use associated types for device resources","user":{"login":"bjz","id":695077,"avatar_url":"https://avatars.githubusercontent.com/u/695077?v=3","gravatar_id":"","url":"https://api.github.com/users/bjz","html_url":"https://github.com/bjz","followers_url":"https://api.github.com/users/bjz/followers","following_url":"https://api.github.com/users/bjz/following{/other_user}","gists_url":"https://api.github.com/users/bjz/gists{/gist_id}","starred_url":"https://api.github.com/users/bjz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjz/subscriptions","organizations_url":"https://api.github.com/users/bjz/orgs","repos_url":"https://api.github.com/users/bjz/repos","events_url":"https://api.github.com/users/bjz/events{/privacy}","received_events_url":"https://api.github.com/users/bjz/received_events","type":"User","site_admin":false},"body":"Gets us closer to #416.\r\n\r\nAn alternative to #517\r\n\r\nFor now I am hard coding the `GlDevice` as the buffer handle device parameters. Currently getting a lifetime error though:\r\n\r\n~~~\r\nsrc/device/lib.rs:203:9: 203:17 error: the associated type `<D as Device>::Buffer` may not live long enough [E0311]\r\nsrc/device/lib.rs:203         self.raw.get_info()\r\n                              ^~~~~~~~\r\nsrc/device/lib.rs:203:9: 203:17 help: consider adding an explicit lifetime bound for `<D as Device>::Buffer`\r\nsrc/device/lib.rs:203         self.raw.get_info()\r\n                              ^~~~~~~~\r\nsrc/device/lib.rs:202:43: 204:6 note: the associated type `<D as Device>::Buffer` must be valid for the anonymous lifetime #1 defined on the block at 202:42...\r\nsrc/device/lib.rs:202     pub fn get_info(&self) -> &BufferInfo {\r\nsrc/device/lib.rs:203         self.raw.get_info()\r\nsrc/device/lib.rs:204     }\r\nsrc/device/lib.rs:203:9: 203:17 note: ...so that the reference type `&Handle<<D as Device>::Buffer, BufferInfo>` does not outlive the data it points at\r\nsrc/device/lib.rs:203         self.raw.get_info()\r\n                              ^~~~~~~~\r\nsrc/device/lib.rs:203:9: 203:17 error: the associated type `<D as Device>::Buffer` may not live long enough [E0311]\r\nsrc/device/lib.rs:203         self.raw.get_info()\r\n                              ^~~~~~~~\r\nsrc/device/lib.rs:203:9: 203:17 help: consider adding an explicit lifetime bound for `<D as Device>::Buffer`\r\nsrc/device/lib.rs:203         self.raw.get_info()\r\n                              ^~~~~~~~\r\nsrc/device/lib.rs:202:43: 204:6 note: the associated type `<D as Device>::Buffer` must be valid for the anonymous lifetime #1 defined on the block at 202:42...\r\nsrc/device/lib.rs:202     pub fn get_info(&self) -> &BufferInfo {\r\nsrc/device/lib.rs:203         self.raw.get_info()\r\nsrc/device/lib.rs:204     }\r\nsrc/device/lib.rs:203:9: 203:17 note: ...so that the reference type `&Handle<<D as Device>::Buffer, BufferInfo>` does not outlive the data it points at\r\nsrc/device/lib.rs:203         self.raw.get_info()\r\n                              ^~~~~~~~\r\nerror: aborting due to 2 previous errors\r\nCould not compile `gfx_device_gl`.\r\n~~~","created_at":"2015-02-14T05:53:09Z","updated_at":"2015-02-14T05:53:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gfx-rs/gfx-rs/pulls/562/commits","review_comments_url":"https://api.github.com/repos/gfx-rs/gfx-rs/pulls/562/comments","review_comment_url":"https://api.github.com/repos/gfx-rs/gfx-rs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/gfx-rs/gfx-rs/issues/562/comments","statuses_url":"https://api.github.com/repos/gfx-rs/gfx-rs/statuses/ca99858b1de5d1f8928f8593de48dc8a053a9337","head":{"label":"bjz:associated-types","ref":"associated-types","sha":"ca99858b1de5d1f8928f8593de48dc8a053a9337","user":{"login":"bjz","id":695077,"avatar_url":"https://avatars.githubusercontent.com/u/695077?v=3","gravatar_id":"","url":"https://api.github.com/users/bjz","html_url":"https://github.com/bjz","followers_url":"https://api.github.com/users/bjz/followers","following_url":"https://api.github.com/users/bjz/following{/other_user}","gists_url":"https://api.github.com/users/bjz/gists{/gist_id}","starred_url":"https://api.github.com/users/bjz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjz/subscriptions","organizations_url":"https://api.github.com/users/bjz/orgs","repos_url":"https://api.github.com/users/bjz/repos","events_url":"https://api.github.com/users/bjz/events{/privacy}","received_events_url":"https://api.github.com/users/bjz/received_events","type":"User","site_admin":false},"repo":{"id":22044587,"name":"gfx-rs","full_name":"bjz/gfx-rs","owner":{"login":"bjz","id":695077,"avatar_url":"https://avatars.githubusercontent.com/u/695077?v=3","gravatar_id":"","url":"https://api.github.com/users/bjz","html_url":"https://github.com/bjz","followers_url":"https://api.github.com/users/bjz/followers","following_url":"https://api.github.com/users/bjz/following{/other_user}","gists_url":"https://api.github.com/users/bjz/gists{/gist_id}","starred_url":"https://api.github.com/users/bjz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjz/subscriptions","organizations_url":"https://api.github.com/users/bjz/orgs","repos_url":"https://api.github.com/users/bjz/repos","events_url":"https://api.github.com/users/bjz/events{/privacy}","received_events_url":"https://api.github.com/users/bjz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bjz/gfx-rs","description":"A lightweight graphics device manager for Rust","fork":true,"url":"https://api.github.com/repos/bjz/gfx-rs","forks_url":"https://api.github.com/repos/bjz/gfx-rs/forks","keys_url":"https://api.github.com/repos/bjz/gfx-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bjz/gfx-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bjz/gfx-rs/teams","hooks_url":"https://api.github.com/repos/bjz/gfx-rs/hooks","issue_events_url":"https://api.github.com/repos/bjz/gfx-rs/issues/events{/number}","events_url":"https://api.github.com/repos/bjz/gfx-rs/events","assignees_url":"https://api.github.com/repos/bjz/gfx-rs/assignees{/user}","branches_url":"https://api.github.com/repos/bjz/gfx-rs/branches{/branch}","tags_url":"https://api.github.com/repos/bjz/gfx-rs/tags","blobs_url":"https://api.github.com/repos/bjz/gfx-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bjz/gfx-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bjz/gfx-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/bjz/gfx-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bjz/gfx-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/bjz/gfx-rs/languages","stargazers_url":"https://api.github.com/repos/bjz/gfx-rs/stargazers","contributors_url":"https://api.github.com/repos/bjz/gfx-rs/contributors","subscribers_url":"https://api.github.com/repos/bjz/gfx-rs/subscribers","subscription_url":"https://api.github.com/repos/bjz/gfx-rs/subscription","commits_url":"https://api.github.com/repos/bjz/gfx-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/bjz/gfx-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/bjz/gfx-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/bjz/gfx-rs/issues/comments/{number}","contents_url":"https://api.github.com/repos/bjz/gfx-rs/contents/{+path}","compare_url":"https://api.github.com/repos/bjz/gfx-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bjz/gfx-rs/merges","archive_url":"https://api.github.com/repos/bjz/gfx-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bjz/gfx-rs/downloads","issues_url":"https://api.github.com/repos/bjz/gfx-rs/issues{/number}","pulls_url":"https://api.github.com/repos/bjz/gfx-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/bjz/gfx-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/bjz/gfx-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bjz/gfx-rs/labels{/name}","releases_url":"https://api.github.com/repos/bjz/gfx-rs/releases{/id}","created_at":"2014-07-20T22:08:24Z","updated_at":"2014-12-06T07:37:31Z","pushed_at":"2015-02-14T05:49:17Z","git_url":"git://github.com/bjz/gfx-rs.git","ssh_url":"git@github.com:bjz/gfx-rs.git","clone_url":"https://github.com/bjz/gfx-rs.git","svn_url":"https://github.com/bjz/gfx-rs","homepage":"","size":1740,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gfx-rs:master","ref":"master","sha":"00175271a5e3f478606e1356e8d74cd64cfcc832","user":{"login":"gfx-rs","id":8213174,"avatar_url":"https://avatars.githubusercontent.com/u/8213174?v=3","gravatar_id":"","url":"https://api.github.com/users/gfx-rs","html_url":"https://github.com/gfx-rs","followers_url":"https://api.github.com/users/gfx-rs/followers","following_url":"https://api.github.com/users/gfx-rs/following{/other_user}","gists_url":"https://api.github.com/users/gfx-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/gfx-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfx-rs/subscriptions","organizations_url":"https://api.github.com/users/gfx-rs/orgs","repos_url":"https://api.github.com/users/gfx-rs/repos","events_url":"https://api.github.com/users/gfx-rs/events{/privacy}","received_events_url":"https://api.github.com/users/gfx-rs/received_events","type":"Organization","site_admin":false},"repo":{"id":13847975,"name":"gfx-rs","full_name":"gfx-rs/gfx-rs","owner":{"login":"gfx-rs","id":8213174,"avatar_url":"https://avatars.githubusercontent.com/u/8213174?v=3","gravatar_id":"","url":"https://api.github.com/users/gfx-rs","html_url":"https://github.com/gfx-rs","followers_url":"https://api.github.com/users/gfx-rs/followers","following_url":"https://api.github.com/users/gfx-rs/following{/other_user}","gists_url":"https://api.github.com/users/gfx-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/gfx-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfx-rs/subscriptions","organizations_url":"https://api.github.com/users/gfx-rs/orgs","repos_url":"https://api.github.com/users/gfx-rs/repos","events_url":"https://api.github.com/users/gfx-rs/events{/privacy}","received_events_url":"https://api.github.com/users/gfx-rs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gfx-rs/gfx-rs","description":"A high-performance, bindless graphics API for Rust.","fork":false,"url":"https://api.github.com/repos/gfx-rs/gfx-rs","forks_url":"https://api.github.com/repos/gfx-rs/gfx-rs/forks","keys_url":"https://api.github.com/repos/gfx-rs/gfx-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gfx-rs/gfx-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gfx-rs/gfx-rs/teams","hooks_url":"https://api.github.com/repos/gfx-rs/gfx-rs/hooks","issue_events_url":"https://api.github.com/repos/gfx-rs/gfx-rs/issues/events{/number}","events_url":"https://api.github.com/repos/gfx-rs/gfx-rs/events","assignees_url":"https://api.github.com/repos/gfx-rs/gfx-rs/assignees{/user}","branches_url":"https://api.github.com/repos/gfx-rs/gfx-rs/branches{/branch}","tags_url":"https://api.github.com/repos/gfx-rs/gfx-rs/tags","blobs_url":"https://api.github.com/repos/gfx-rs/gfx-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gfx-rs/gfx-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gfx-rs/gfx-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/gfx-rs/gfx-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gfx-rs/gfx-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/gfx-rs/gfx-rs/languages","stargazers_url":"https://api.github.com/repos/gfx-rs/gfx-rs/stargazers","contributors_url":"https://api.github.com/repos/gfx-rs/gfx-rs/contributors","subscribers_url":"https://api.github.com/repos/gfx-rs/gfx-rs/subscribers","subscription_url":"https://api.github.com/repos/gfx-rs/gfx-rs/subscription","commits_url":"https://api.github.com/repos/gfx-rs/gfx-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/gfx-rs/gfx-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/gfx-rs/gfx-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/gfx-rs/gfx-rs/issues/comments/{number}","contents_url":"https://api.github.com/repos/gfx-rs/gfx-rs/contents/{+path}","compare_url":"https://api.github.com/repos/gfx-rs/gfx-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gfx-rs/gfx-rs/merges","archive_url":"https://api.github.com/repos/gfx-rs/gfx-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gfx-rs/gfx-rs/downloads","issues_url":"https://api.github.com/repos/gfx-rs/gfx-rs/issues{/number}","pulls_url":"https://api.github.com/repos/gfx-rs/gfx-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/gfx-rs/gfx-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/gfx-rs/gfx-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gfx-rs/gfx-rs/labels{/name}","releases_url":"https://api.github.com/repos/gfx-rs/gfx-rs/releases{/id}","created_at":"2013-10-25T00:35:35Z","updated_at":"2015-02-14T03:09:33Z","pushed_at":"2015-02-14T03:09:33Z","git_url":"git://github.com/gfx-rs/gfx-rs.git","ssh_url":"git@github.com:gfx-rs/gfx-rs.git","clone_url":"https://github.com/gfx-rs/gfx-rs.git","svn_url":"https://github.com/gfx-rs/gfx-rs","homepage":"http://gfx-rs.github.io/","size":4482,"stargazers_count":292,"watchers_count":292,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":62,"forks":64,"open_issues":62,"watchers":292,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gfx-rs/gfx-rs/pulls/562"},"html":{"href":"https://github.com/gfx-rs/gfx-rs/pull/562"},"issue":{"href":"https://api.github.com/repos/gfx-rs/gfx-rs/issues/562"},"comments":{"href":"https://api.github.com/repos/gfx-rs/gfx-rs/issues/562/comments"},"review_comments":{"href":"https://api.github.com/repos/gfx-rs/gfx-rs/pulls/562/comments"},"review_comment":{"href":"https://api.github.com/repos/gfx-rs/gfx-rs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/gfx-rs/gfx-rs/pulls/562/commits"},"statuses":{"href":"https://api.github.com/repos/gfx-rs/gfx-rs/statuses/ca99858b1de5d1f8928f8593de48dc8a053a9337"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":150,"deletions":114,"changed_files":5}}