{"action":"created","comment":{"url":"https://api.github.com/repos/servo/rust-bindgen/pulls/comments/88633983","pull_request_review_id":9201741,"id":88633983,"diff_hunk":"@@ -525,6 +526,107 @@ impl Item {\n         self.as_type().map_or(false, |ty| ty.is_type_ref())\n     }\n \n+    /// Get the target item id for name generation.\n+    fn name_target(&self, ctx: &BindgenContext, for_name_checking: bool) -> ItemId {\n+        let mut item = self;\n+        loop {\n+            match *item.kind() {\n+                ItemKind::Type(ref ty) => {\n+                    match *ty.kind() {\n+                        // If we're a template specialization, our name is our\n+                        // parent's name.\n+                        TypeKind::Comp(ref ci) if ci.is_template_specialization() => {\n+                            item = ctx.resolve_item(ci.specialized_template().unwrap());","path":"libbindgen/src/ir/item.rs","position":34,"original_position":34,"commit_id":"cfbb7d4511edd687a02ad933566fadac1ef8338b","original_commit_id":"cfbb7d4511edd687a02ad933566fadac1ef8338b","user":{"login":"emilio","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false},"body":"and here we may be able to just do `return ci.specialized_template()`, this can't be recursive if I'm not wrong.","created_at":"2016-11-18T10:34:37Z","updated_at":"2016-11-18T10:40:05Z","html_url":"https://github.com/servo/rust-bindgen/pull/281#discussion_r88633983","pull_request_url":"https://api.github.com/repos/servo/rust-bindgen/pulls/281","_links":{"self":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/comments/88633983"},"html":{"href":"https://github.com/servo/rust-bindgen/pull/281#discussion_r88633983"},"pull_request":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/281"}}},"pull_request":{"url":"https://api.github.com/repos/servo/rust-bindgen/pulls/281","id":94283472,"html_url":"https://github.com/servo/rust-bindgen/pull/281","diff_url":"https://github.com/servo/rust-bindgen/pull/281.diff","patch_url":"https://github.com/servo/rust-bindgen/pull/281.patch","issue_url":"https://api.github.com/repos/servo/rust-bindgen/issues/281","number":281,"state":"open","locked":false,"title":"Include namespaces in mangled symbols","user":{"login":"fitzgen","id":74571,"avatar_url":"https://avatars.githubusercontent.com/u/74571?v=3","gravatar_id":"","url":"https://api.github.com/users/fitzgen","html_url":"https://github.com/fitzgen","followers_url":"https://api.github.com/users/fitzgen/followers","following_url":"https://api.github.com/users/fitzgen/following{/other_user}","gists_url":"https://api.github.com/users/fitzgen/gists{/gist_id}","starred_url":"https://api.github.com/users/fitzgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fitzgen/subscriptions","organizations_url":"https://api.github.com/users/fitzgen/orgs","repos_url":"https://api.github.com/users/fitzgen/repos","events_url":"https://api.github.com/users/fitzgen/events{/privacy}","received_events_url":"https://api.github.com/users/fitzgen/received_events","type":"User","site_admin":false},"body":"When we aren't using `--enable-cxx-namespaces`, we can end up with\r\nconflicting struct symbol names that we need to disambiguate. The\r\nsolution is to mangle the namespaced C++ symbol \"foo::bar::Baz\" into the\r\nRust \"foo_bar_Baz\" symbol.\r\n\r\nThis did change the way anonymous types and modules get named a little,\r\nbut I think our approach is much more sane now than it was before.\r\n\r\nFixes #267.\r\n\r\nr? @emilio ","created_at":"2016-11-18T00:51:04Z","updated_at":"2016-11-18T10:40:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53684514ab70e45d49894ea617a679648b1f4aab","assignee":{"login":"emilio","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false},"assignees":[{"login":"emilio","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/servo/rust-bindgen/pulls/281/commits","review_comments_url":"https://api.github.com/repos/servo/rust-bindgen/pulls/281/comments","review_comment_url":"https://api.github.com/repos/servo/rust-bindgen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/rust-bindgen/issues/281/comments","statuses_url":"https://api.github.com/repos/servo/rust-bindgen/statuses/cfbb7d4511edd687a02ad933566fadac1ef8338b","head":{"label":"fitzgen:namespace-mangle-rust-symbols","ref":"namespace-mangle-rust-symbols","sha":"cfbb7d4511edd687a02ad933566fadac1ef8338b","user":{"login":"fitzgen","id":74571,"avatar_url":"https://avatars.githubusercontent.com/u/74571?v=3","gravatar_id":"","url":"https://api.github.com/users/fitzgen","html_url":"https://github.com/fitzgen","followers_url":"https://api.github.com/users/fitzgen/followers","following_url":"https://api.github.com/users/fitzgen/following{/other_user}","gists_url":"https://api.github.com/users/fitzgen/gists{/gist_id}","starred_url":"https://api.github.com/users/fitzgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fitzgen/subscriptions","organizations_url":"https://api.github.com/users/fitzgen/orgs","repos_url":"https://api.github.com/users/fitzgen/repos","events_url":"https://api.github.com/users/fitzgen/events{/privacy}","received_events_url":"https://api.github.com/users/fitzgen/received_events","type":"User","site_admin":false},"repo":{"id":63630827,"name":"rust-bindgen","full_name":"fitzgen/rust-bindgen","owner":{"login":"fitzgen","id":74571,"avatar_url":"https://avatars.githubusercontent.com/u/74571?v=3","gravatar_id":"","url":"https://api.github.com/users/fitzgen","html_url":"https://github.com/fitzgen","followers_url":"https://api.github.com/users/fitzgen/followers","following_url":"https://api.github.com/users/fitzgen/following{/other_user}","gists_url":"https://api.github.com/users/fitzgen/gists{/gist_id}","starred_url":"https://api.github.com/users/fitzgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fitzgen/subscriptions","organizations_url":"https://api.github.com/users/fitzgen/orgs","repos_url":"https://api.github.com/users/fitzgen/repos","events_url":"https://api.github.com/users/fitzgen/events{/privacy}","received_events_url":"https://api.github.com/users/fitzgen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fitzgen/rust-bindgen","description":"binding generator for rust language","fork":true,"url":"https://api.github.com/repos/fitzgen/rust-bindgen","forks_url":"https://api.github.com/repos/fitzgen/rust-bindgen/forks","keys_url":"https://api.github.com/repos/fitzgen/rust-bindgen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fitzgen/rust-bindgen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fitzgen/rust-bindgen/teams","hooks_url":"https://api.github.com/repos/fitzgen/rust-bindgen/hooks","issue_events_url":"https://api.github.com/repos/fitzgen/rust-bindgen/issues/events{/number}","events_url":"https://api.github.com/repos/fitzgen/rust-bindgen/events","assignees_url":"https://api.github.com/repos/fitzgen/rust-bindgen/assignees{/user}","branches_url":"https://api.github.com/repos/fitzgen/rust-bindgen/branches{/branch}","tags_url":"https://api.github.com/repos/fitzgen/rust-bindgen/tags","blobs_url":"https://api.github.com/repos/fitzgen/rust-bindgen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fitzgen/rust-bindgen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fitzgen/rust-bindgen/git/refs{/sha}","trees_url":"https://api.github.com/repos/fitzgen/rust-bindgen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fitzgen/rust-bindgen/statuses/{sha}","languages_url":"https://api.github.com/repos/fitzgen/rust-bindgen/languages","stargazers_url":"https://api.github.com/repos/fitzgen/rust-bindgen/stargazers","contributors_url":"https://api.github.com/repos/fitzgen/rust-bindgen/contributors","subscribers_url":"https://api.github.com/repos/fitzgen/rust-bindgen/subscribers","subscription_url":"https://api.github.com/repos/fitzgen/rust-bindgen/subscription","commits_url":"https://api.github.com/repos/fitzgen/rust-bindgen/commits{/sha}","git_commits_url":"https://api.github.com/repos/fitzgen/rust-bindgen/git/commits{/sha}","comments_url":"https://api.github.com/repos/fitzgen/rust-bindgen/comments{/number}","issue_comment_url":"https://api.github.com/repos/fitzgen/rust-bindgen/issues/comments{/number}","contents_url":"https://api.github.com/repos/fitzgen/rust-bindgen/contents/{+path}","compare_url":"https://api.github.com/repos/fitzgen/rust-bindgen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fitzgen/rust-bindgen/merges","archive_url":"https://api.github.com/repos/fitzgen/rust-bindgen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fitzgen/rust-bindgen/downloads","issues_url":"https://api.github.com/repos/fitzgen/rust-bindgen/issues{/number}","pulls_url":"https://api.github.com/repos/fitzgen/rust-bindgen/pulls{/number}","milestones_url":"https://api.github.com/repos/fitzgen/rust-bindgen/milestones{/number}","notifications_url":"https://api.github.com/repos/fitzgen/rust-bindgen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fitzgen/rust-bindgen/labels{/name}","releases_url":"https://api.github.com/repos/fitzgen/rust-bindgen/releases{/id}","deployments_url":"https://api.github.com/repos/fitzgen/rust-bindgen/deployments","created_at":"2016-07-18T19:26:42Z","updated_at":"2016-07-18T19:26:43Z","pushed_at":"2016-11-18T00:50:17Z","git_url":"git://github.com/fitzgen/rust-bindgen.git","ssh_url":"git@github.com:fitzgen/rust-bindgen.git","clone_url":"https://github.com/fitzgen/rust-bindgen.git","svn_url":"https://github.com/fitzgen/rust-bindgen","homepage":"","size":8059,"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":"servo:master","ref":"master","sha":"53173928934b67dc62389dac6771d27b73b288e9","user":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"repo":{"id":61728459,"name":"rust-bindgen","full_name":"servo/rust-bindgen","owner":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/servo/rust-bindgen","description":"binding generator for rust language","fork":true,"url":"https://api.github.com/repos/servo/rust-bindgen","forks_url":"https://api.github.com/repos/servo/rust-bindgen/forks","keys_url":"https://api.github.com/repos/servo/rust-bindgen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/servo/rust-bindgen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/servo/rust-bindgen/teams","hooks_url":"https://api.github.com/repos/servo/rust-bindgen/hooks","issue_events_url":"https://api.github.com/repos/servo/rust-bindgen/issues/events{/number}","events_url":"https://api.github.com/repos/servo/rust-bindgen/events","assignees_url":"https://api.github.com/repos/servo/rust-bindgen/assignees{/user}","branches_url":"https://api.github.com/repos/servo/rust-bindgen/branches{/branch}","tags_url":"https://api.github.com/repos/servo/rust-bindgen/tags","blobs_url":"https://api.github.com/repos/servo/rust-bindgen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/servo/rust-bindgen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/servo/rust-bindgen/git/refs{/sha}","trees_url":"https://api.github.com/repos/servo/rust-bindgen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/servo/rust-bindgen/statuses/{sha}","languages_url":"https://api.github.com/repos/servo/rust-bindgen/languages","stargazers_url":"https://api.github.com/repos/servo/rust-bindgen/stargazers","contributors_url":"https://api.github.com/repos/servo/rust-bindgen/contributors","subscribers_url":"https://api.github.com/repos/servo/rust-bindgen/subscribers","subscription_url":"https://api.github.com/repos/servo/rust-bindgen/subscription","commits_url":"https://api.github.com/repos/servo/rust-bindgen/commits{/sha}","git_commits_url":"https://api.github.com/repos/servo/rust-bindgen/git/commits{/sha}","comments_url":"https://api.github.com/repos/servo/rust-bindgen/comments{/number}","issue_comment_url":"https://api.github.com/repos/servo/rust-bindgen/issues/comments{/number}","contents_url":"https://api.github.com/repos/servo/rust-bindgen/contents/{+path}","compare_url":"https://api.github.com/repos/servo/rust-bindgen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/servo/rust-bindgen/merges","archive_url":"https://api.github.com/repos/servo/rust-bindgen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/servo/rust-bindgen/downloads","issues_url":"https://api.github.com/repos/servo/rust-bindgen/issues{/number}","pulls_url":"https://api.github.com/repos/servo/rust-bindgen/pulls{/number}","milestones_url":"https://api.github.com/repos/servo/rust-bindgen/milestones{/number}","notifications_url":"https://api.github.com/repos/servo/rust-bindgen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/servo/rust-bindgen/labels{/name}","releases_url":"https://api.github.com/repos/servo/rust-bindgen/releases{/id}","deployments_url":"https://api.github.com/repos/servo/rust-bindgen/deployments","created_at":"2016-06-22T15:05:51Z","updated_at":"2016-11-17T11:50:03Z","pushed_at":"2016-11-18T02:07:35Z","git_url":"git://github.com/servo/rust-bindgen.git","ssh_url":"git@github.com:servo/rust-bindgen.git","clone_url":"https://github.com/servo/rust-bindgen.git","svn_url":"https://github.com/servo/rust-bindgen","homepage":"","size":8178,"stargazers_count":43,"watchers_count":43,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":41,"forks":35,"open_issues":41,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/281"},"html":{"href":"https://github.com/servo/rust-bindgen/pull/281"},"issue":{"href":"https://api.github.com/repos/servo/rust-bindgen/issues/281"},"comments":{"href":"https://api.github.com/repos/servo/rust-bindgen/issues/281/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/281/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/281/commits"},"statuses":{"href":"https://api.github.com/repos/servo/rust-bindgen/statuses/cfbb7d4511edd687a02ad933566fadac1ef8338b"}}}}
{"actor":{"display_login":"emilio"}}