{"action":"created","comment":{"url":"https://api.github.com/repos/Rantanen/intercom/pulls/comments/167447940","pull_request_review_id":95668308,"id":167447940,"diff_hunk":"@@ -1,59 +1,174 @@\n+extern crate std;\n+\n use model::ComCrate;\n use syn;\n \n+/// Detailed information of a Rust type.\n+pub enum RustType<'e>\n+{\n+    Ident( &'e syn::Ident ),\n+    Void,\n+}\n+\n+/// Defines how a value is passed to/from Rust function.\n+#[derive(PartialEq, PartialOrd, Clone)]\n+pub enum PassBy\n+{\n+    Value,\n+\n+    Reference,\n+\n+    Ptr,\n+}\n+\n+/// Details of a Rust type. Used for translation to other programming languages.\n+pub struct TypeInfo<'s>\n+{\n+    /// The crate this type is associated with.\n+    pub krate: &'s ComCrate,\n+\n+    /// The type in rust.\n+    pub rust_type: RustType<'s>,\n+\n+    /// Specifies how the value is passed to/from a function. Default: PassBy::Value\n+    pub pass_by: PassBy,\n+\n+    /// Is the Rust type defined as mutable? Default: false\n+    pub is_mutable: bool,\n+\n+    /// The length of the array if the Rust type denotes an array.\n+    pub array_length: Option<&'s syn::Expr>\n+}\n+\n pub trait ForeignTypeHandler\n {\n     /// Gets the name for the 'ty'.\n     fn get_name( &self, krate : &ComCrate, ty : &syn::Ident ) -> String;\n \n     /// Gets the COM type for a Rust type.\n-    fn get_ty( &self, krate : &ComCrate, ty : &syn::Type ) -> Option< String >;\n+    fn get_ty<'a, 'b: 'a>( &self, krate : &'b ComCrate, ty : &'b syn::Type ) -> Option< TypeInfo<'a> >;","path":"intercom-common/src/foreign_ty.rs","position":50,"original_position":50,"commit_id":"6bf73769cc5c59f36b125a47685c9ed35b1f0303","original_commit_id":"46a9b5307fb6c5a854e543527f797c8cc8ca5b53","user":{"login":"Fluxie","id":2579060,"avatar_url":"https://avatars1.githubusercontent.com/u/2579060?v=4","gravatar_id":"","url":"https://api.github.com/users/Fluxie","html_url":"https://github.com/Fluxie","followers_url":"https://api.github.com/users/Fluxie/followers","following_url":"https://api.github.com/users/Fluxie/following{/other_user}","gists_url":"https://api.github.com/users/Fluxie/gists{/gist_id}","starred_url":"https://api.github.com/users/Fluxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fluxie/subscriptions","organizations_url":"https://api.github.com/users/Fluxie/orgs","repos_url":"https://api.github.com/users/Fluxie/repos","events_url":"https://api.github.com/users/Fluxie/events{/privacy}","received_events_url":"https://api.github.com/users/Fluxie/received_events","type":"User","site_admin":false},"body":"But if I remember correctly part of the problem was that the TypeInfoResolver died before the parameters and they had the same lifetime.\r\n\r\nThe chapter on [Advanced Lifetimes](https://doc.rust-lang.org/book/second-edition/ch19-02-advanced-lifetimes.html) might help.\r\n","created_at":"2018-02-11T20:25:24Z","updated_at":"2018-02-11T20:25:24Z","html_url":"https://github.com/Rantanen/intercom/pull/57#discussion_r167447940","pull_request_url":"https://api.github.com/repos/Rantanen/intercom/pulls/57","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Rantanen/intercom/pulls/comments/167447940"},"html":{"href":"https://github.com/Rantanen/intercom/pull/57#discussion_r167447940"},"pull_request":{"href":"https://api.github.com/repos/Rantanen/intercom/pulls/57"}},"in_reply_to_id":167444323},"pull_request":{"url":"https://api.github.com/repos/Rantanen/intercom/pulls/57","id":168465987,"html_url":"https://github.com/Rantanen/intercom/pull/57","diff_url":"https://github.com/Rantanen/intercom/pull/57.diff","patch_url":"https://github.com/Rantanen/intercom/pull/57.patch","issue_url":"https://api.github.com/repos/Rantanen/intercom/issues/57","number":57,"state":"open","locked":false,"title":"Return structured information from parsing a crate","user":{"login":"Fluxie","id":2579060,"avatar_url":"https://avatars1.githubusercontent.com/u/2579060?v=4","gravatar_id":"","url":"https://api.github.com/users/Fluxie","html_url":"https://github.com/Fluxie","followers_url":"https://api.github.com/users/Fluxie/followers","following_url":"https://api.github.com/users/Fluxie/following{/other_user}","gists_url":"https://api.github.com/users/Fluxie/gists{/gist_id}","starred_url":"https://api.github.com/users/Fluxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fluxie/subscriptions","organizations_url":"https://api.github.com/users/Fluxie/orgs","repos_url":"https://api.github.com/users/Fluxie/repos","events_url":"https://api.github.com/users/Fluxie/events{/privacy}","received_events_url":"https://api.github.com/users/Fluxie/received_events","type":"User","site_admin":false},"body":"The more structured type information in the generation stage\r\nenables e.g. proper const modifiers for the C++ interfaces.\r\n\r\nOutput format specific conversion logic was moved\r\nto appropriate generators.","created_at":"2018-02-11T18:14:05Z","updated_at":"2018-02-11T20:25:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b03e704bbf3928a98890c4403027d229393dc5f6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Rantanen/intercom/pulls/57/commits","review_comments_url":"https://api.github.com/repos/Rantanen/intercom/pulls/57/comments","review_comment_url":"https://api.github.com/repos/Rantanen/intercom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Rantanen/intercom/issues/57/comments","statuses_url":"https://api.github.com/repos/Rantanen/intercom/statuses/6bf73769cc5c59f36b125a47685c9ed35b1f0303","head":{"label":"Fluxie:structured-type-info","ref":"structured-type-info","sha":"6bf73769cc5c59f36b125a47685c9ed35b1f0303","user":{"login":"Fluxie","id":2579060,"avatar_url":"https://avatars1.githubusercontent.com/u/2579060?v=4","gravatar_id":"","url":"https://api.github.com/users/Fluxie","html_url":"https://github.com/Fluxie","followers_url":"https://api.github.com/users/Fluxie/followers","following_url":"https://api.github.com/users/Fluxie/following{/other_user}","gists_url":"https://api.github.com/users/Fluxie/gists{/gist_id}","starred_url":"https://api.github.com/users/Fluxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fluxie/subscriptions","organizations_url":"https://api.github.com/users/Fluxie/orgs","repos_url":"https://api.github.com/users/Fluxie/repos","events_url":"https://api.github.com/users/Fluxie/events{/privacy}","received_events_url":"https://api.github.com/users/Fluxie/received_events","type":"User","site_admin":false},"repo":{"id":113290379,"name":"intercom","full_name":"Fluxie/intercom","owner":{"login":"Fluxie","id":2579060,"avatar_url":"https://avatars1.githubusercontent.com/u/2579060?v=4","gravatar_id":"","url":"https://api.github.com/users/Fluxie","html_url":"https://github.com/Fluxie","followers_url":"https://api.github.com/users/Fluxie/followers","following_url":"https://api.github.com/users/Fluxie/following{/other_user}","gists_url":"https://api.github.com/users/Fluxie/gists{/gist_id}","starred_url":"https://api.github.com/users/Fluxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fluxie/subscriptions","organizations_url":"https://api.github.com/users/Fluxie/orgs","repos_url":"https://api.github.com/users/Fluxie/repos","events_url":"https://api.github.com/users/Fluxie/events{/privacy}","received_events_url":"https://api.github.com/users/Fluxie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Fluxie/intercom","description":"Microsoft COM export functionality for Rust libraries","fork":true,"url":"https://api.github.com/repos/Fluxie/intercom","forks_url":"https://api.github.com/repos/Fluxie/intercom/forks","keys_url":"https://api.github.com/repos/Fluxie/intercom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fluxie/intercom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fluxie/intercom/teams","hooks_url":"https://api.github.com/repos/Fluxie/intercom/hooks","issue_events_url":"https://api.github.com/repos/Fluxie/intercom/issues/events{/number}","events_url":"https://api.github.com/repos/Fluxie/intercom/events","assignees_url":"https://api.github.com/repos/Fluxie/intercom/assignees{/user}","branches_url":"https://api.github.com/repos/Fluxie/intercom/branches{/branch}","tags_url":"https://api.github.com/repos/Fluxie/intercom/tags","blobs_url":"https://api.github.com/repos/Fluxie/intercom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fluxie/intercom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fluxie/intercom/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fluxie/intercom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fluxie/intercom/statuses/{sha}","languages_url":"https://api.github.com/repos/Fluxie/intercom/languages","stargazers_url":"https://api.github.com/repos/Fluxie/intercom/stargazers","contributors_url":"https://api.github.com/repos/Fluxie/intercom/contributors","subscribers_url":"https://api.github.com/repos/Fluxie/intercom/subscribers","subscription_url":"https://api.github.com/repos/Fluxie/intercom/subscription","commits_url":"https://api.github.com/repos/Fluxie/intercom/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fluxie/intercom/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fluxie/intercom/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fluxie/intercom/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fluxie/intercom/contents/{+path}","compare_url":"https://api.github.com/repos/Fluxie/intercom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fluxie/intercom/merges","archive_url":"https://api.github.com/repos/Fluxie/intercom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fluxie/intercom/downloads","issues_url":"https://api.github.com/repos/Fluxie/intercom/issues{/number}","pulls_url":"https://api.github.com/repos/Fluxie/intercom/pulls{/number}","milestones_url":"https://api.github.com/repos/Fluxie/intercom/milestones{/number}","notifications_url":"https://api.github.com/repos/Fluxie/intercom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fluxie/intercom/labels{/name}","releases_url":"https://api.github.com/repos/Fluxie/intercom/releases{/id}","deployments_url":"https://api.github.com/repos/Fluxie/intercom/deployments","created_at":"2017-12-06T08:38:09Z","updated_at":"2017-12-06T08:38:11Z","pushed_at":"2018-02-11T18:45:12Z","git_url":"git://github.com/Fluxie/intercom.git","ssh_url":"git@github.com:Fluxie/intercom.git","clone_url":"https://github.com/Fluxie/intercom.git","svn_url":"https://github.com/Fluxie/intercom","homepage":null,"size":1087,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Rantanen:master","ref":"master","sha":"5a6b2ec0d36f5a7f7c3210e8c521ac4230488301","user":{"login":"Rantanen","id":385385,"avatar_url":"https://avatars0.githubusercontent.com/u/385385?v=4","gravatar_id":"","url":"https://api.github.com/users/Rantanen","html_url":"https://github.com/Rantanen","followers_url":"https://api.github.com/users/Rantanen/followers","following_url":"https://api.github.com/users/Rantanen/following{/other_user}","gists_url":"https://api.github.com/users/Rantanen/gists{/gist_id}","starred_url":"https://api.github.com/users/Rantanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rantanen/subscriptions","organizations_url":"https://api.github.com/users/Rantanen/orgs","repos_url":"https://api.github.com/users/Rantanen/repos","events_url":"https://api.github.com/users/Rantanen/events{/privacy}","received_events_url":"https://api.github.com/users/Rantanen/received_events","type":"User","site_admin":false},"repo":{"id":107910732,"name":"intercom","full_name":"Rantanen/intercom","owner":{"login":"Rantanen","id":385385,"avatar_url":"https://avatars0.githubusercontent.com/u/385385?v=4","gravatar_id":"","url":"https://api.github.com/users/Rantanen","html_url":"https://github.com/Rantanen","followers_url":"https://api.github.com/users/Rantanen/followers","following_url":"https://api.github.com/users/Rantanen/following{/other_user}","gists_url":"https://api.github.com/users/Rantanen/gists{/gist_id}","starred_url":"https://api.github.com/users/Rantanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rantanen/subscriptions","organizations_url":"https://api.github.com/users/Rantanen/orgs","repos_url":"https://api.github.com/users/Rantanen/repos","events_url":"https://api.github.com/users/Rantanen/events{/privacy}","received_events_url":"https://api.github.com/users/Rantanen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Rantanen/intercom","description":"Object based cross-language FFI for Rust","fork":false,"url":"https://api.github.com/repos/Rantanen/intercom","forks_url":"https://api.github.com/repos/Rantanen/intercom/forks","keys_url":"https://api.github.com/repos/Rantanen/intercom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Rantanen/intercom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Rantanen/intercom/teams","hooks_url":"https://api.github.com/repos/Rantanen/intercom/hooks","issue_events_url":"https://api.github.com/repos/Rantanen/intercom/issues/events{/number}","events_url":"https://api.github.com/repos/Rantanen/intercom/events","assignees_url":"https://api.github.com/repos/Rantanen/intercom/assignees{/user}","branches_url":"https://api.github.com/repos/Rantanen/intercom/branches{/branch}","tags_url":"https://api.github.com/repos/Rantanen/intercom/tags","blobs_url":"https://api.github.com/repos/Rantanen/intercom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Rantanen/intercom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Rantanen/intercom/git/refs{/sha}","trees_url":"https://api.github.com/repos/Rantanen/intercom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Rantanen/intercom/statuses/{sha}","languages_url":"https://api.github.com/repos/Rantanen/intercom/languages","stargazers_url":"https://api.github.com/repos/Rantanen/intercom/stargazers","contributors_url":"https://api.github.com/repos/Rantanen/intercom/contributors","subscribers_url":"https://api.github.com/repos/Rantanen/intercom/subscribers","subscription_url":"https://api.github.com/repos/Rantanen/intercom/subscription","commits_url":"https://api.github.com/repos/Rantanen/intercom/commits{/sha}","git_commits_url":"https://api.github.com/repos/Rantanen/intercom/git/commits{/sha}","comments_url":"https://api.github.com/repos/Rantanen/intercom/comments{/number}","issue_comment_url":"https://api.github.com/repos/Rantanen/intercom/issues/comments{/number}","contents_url":"https://api.github.com/repos/Rantanen/intercom/contents/{+path}","compare_url":"https://api.github.com/repos/Rantanen/intercom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Rantanen/intercom/merges","archive_url":"https://api.github.com/repos/Rantanen/intercom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Rantanen/intercom/downloads","issues_url":"https://api.github.com/repos/Rantanen/intercom/issues{/number}","pulls_url":"https://api.github.com/repos/Rantanen/intercom/pulls{/number}","milestones_url":"https://api.github.com/repos/Rantanen/intercom/milestones{/number}","notifications_url":"https://api.github.com/repos/Rantanen/intercom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Rantanen/intercom/labels{/name}","releases_url":"https://api.github.com/repos/Rantanen/intercom/releases{/id}","deployments_url":"https://api.github.com/repos/Rantanen/intercom/deployments","created_at":"2017-10-22T23:25:42Z","updated_at":"2018-02-11T19:27:00Z","pushed_at":"2018-02-11T18:45:13Z","git_url":"git://github.com/Rantanen/intercom.git","ssh_url":"git@github.com:Rantanen/intercom.git","clone_url":"https://github.com/Rantanen/intercom.git","svn_url":"https://github.com/Rantanen/intercom","homepage":"","size":870,"stargazers_count":4,"watchers_count":4,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":18,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Rantanen/intercom/pulls/57"},"html":{"href":"https://github.com/Rantanen/intercom/pull/57"},"issue":{"href":"https://api.github.com/repos/Rantanen/intercom/issues/57"},"comments":{"href":"https://api.github.com/repos/Rantanen/intercom/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/Rantanen/intercom/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/Rantanen/intercom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Rantanen/intercom/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/Rantanen/intercom/statuses/6bf73769cc5c59f36b125a47685c9ed35b1f0303"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Fluxie"}}