{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/30116240","id":30116240,"diff_hunk":"@@ -885,24 +885,31 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {\n \n     /// Checks that imported names and items don't have the same name.\n     fn check_for_conflicting_import(&mut self,\n-                                    target: &Option<Target>,\n+                                    import_resolution: &ImportResolution,\n                                     import_span: Span,\n                                     name: Name,\n                                     namespace: Namespace) {\n+        let target = import_resolution.target_for_namespace(namespace);\n         debug!(\"check_for_conflicting_import: {}; target exists: {}\",\n                &token::get_name(name),\n                target.is_some());\n \n-        match *target {\n+        match target {\n             Some(ref target) if target.shadowable != Shadowable::Always => {\n-                let msg = format!(\"a {} named `{}` has already been imported \\\n-                                   in this module\",\n-                                  match namespace {\n-                                    TypeNS => \"type\",\n-                                    ValueNS => \"value\",\n-                                  },\n+                let ns_word = match namespace {\n+                    TypeNS => \"type\",\n+                    ValueNS => \"value\",\n+                };\n+                span_err!(self.resolver.session, import_span, E0252,\n+                          \"a {} named `{}` has already been imported \\\n+                           in this module\", ns_word,\n                                   &token::get_name(name));\n-                span_err!(self.resolver.session, import_span, E0252, \"{}\", &msg[..]);\n+                let use_id = import_resolution.id(namespace);\n+                let item = self.resolver.ast_map.expect_item(use_id);\n+                // item is syntax::ast::Item;","path":"src/librustc_resolve/resolve_imports.rs","position":61,"original_position":61,"commit_id":"db9d01842450fe07f77ca97d9a68d105366f407e","original_commit_id":"db9d01842450fe07f77ca97d9a68d105366f407e","user":{"login":"pnkfelix","id":173127,"avatar_url":"https://avatars.githubusercontent.com/u/173127?v=3","gravatar_id":"","url":"https://api.github.com/users/pnkfelix","html_url":"https://github.com/pnkfelix","followers_url":"https://api.github.com/users/pnkfelix/followers","following_url":"https://api.github.com/users/pnkfelix/following{/other_user}","gists_url":"https://api.github.com/users/pnkfelix/gists{/gist_id}","starred_url":"https://api.github.com/users/pnkfelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnkfelix/subscriptions","organizations_url":"https://api.github.com/users/pnkfelix/orgs","repos_url":"https://api.github.com/users/pnkfelix/repos","events_url":"https://api.github.com/users/pnkfelix/events{/privacy}","received_events_url":"https://api.github.com/users/pnkfelix/received_events","type":"User","site_admin":false},"body":"Nit: I'd prefer a type annotation in code rather than in a comment.","created_at":"2015-05-12T09:05:55Z","updated_at":"2015-05-12T09:05:55Z","html_url":"https://github.com/rust-lang/rust/pull/24818#discussion_r30116240","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/24818","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/30116240"},"html":{"href":"https://github.com/rust-lang/rust/pull/24818#discussion_r30116240"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/24818"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/24818","id":34110442,"html_url":"https://github.com/rust-lang/rust/pull/24818","diff_url":"https://github.com/rust-lang/rust/pull/24818.diff","patch_url":"https://github.com/rust-lang/rust/pull/24818.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/24818","number":24818,"state":"open","locked":false,"title":"First attempt at fixing #20591","user":{"login":"tbelaire","id":427239,"avatar_url":"https://avatars.githubusercontent.com/u/427239?v=3","gravatar_id":"","url":"https://api.github.com/users/tbelaire","html_url":"https://github.com/tbelaire","followers_url":"https://api.github.com/users/tbelaire/followers","following_url":"https://api.github.com/users/tbelaire/following{/other_user}","gists_url":"https://api.github.com/users/tbelaire/gists{/gist_id}","starred_url":"https://api.github.com/users/tbelaire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbelaire/subscriptions","organizations_url":"https://api.github.com/users/tbelaire/orgs","repos_url":"https://api.github.com/users/tbelaire/repos","events_url":"https://api.github.com/users/tbelaire/events{/privacy}","received_events_url":"https://api.github.com/users/tbelaire/received_events","type":"User","site_admin":false},"body":"This isn't quite right, but it's interesting.","created_at":"2015-04-25T18:11:13Z","updated_at":"2015-05-12T09:05:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7bb7761cf76c2e64b8564f755cea0842820045d","assignee":{"login":"nrc","id":762626,"avatar_url":"https://avatars.githubusercontent.com/u/762626?v=3","gravatar_id":"","url":"https://api.github.com/users/nrc","html_url":"https://github.com/nrc","followers_url":"https://api.github.com/users/nrc/followers","following_url":"https://api.github.com/users/nrc/following{/other_user}","gists_url":"https://api.github.com/users/nrc/gists{/gist_id}","starred_url":"https://api.github.com/users/nrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrc/subscriptions","organizations_url":"https://api.github.com/users/nrc/orgs","repos_url":"https://api.github.com/users/nrc/repos","events_url":"https://api.github.com/users/nrc/events{/privacy}","received_events_url":"https://api.github.com/users/nrc/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/24818/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/24818/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/24818/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/db9d01842450fe07f77ca97d9a68d105366f407e","head":{"label":"tbelaire:double-import","ref":"double-import","sha":"db9d01842450fe07f77ca97d9a68d105366f407e","user":{"login":"tbelaire","id":427239,"avatar_url":"https://avatars.githubusercontent.com/u/427239?v=3","gravatar_id":"","url":"https://api.github.com/users/tbelaire","html_url":"https://github.com/tbelaire","followers_url":"https://api.github.com/users/tbelaire/followers","following_url":"https://api.github.com/users/tbelaire/following{/other_user}","gists_url":"https://api.github.com/users/tbelaire/gists{/gist_id}","starred_url":"https://api.github.com/users/tbelaire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbelaire/subscriptions","organizations_url":"https://api.github.com/users/tbelaire/orgs","repos_url":"https://api.github.com/users/tbelaire/repos","events_url":"https://api.github.com/users/tbelaire/events{/privacy}","received_events_url":"https://api.github.com/users/tbelaire/received_events","type":"User","site_admin":false},"repo":{"id":33803842,"name":"rust","full_name":"tbelaire/rust","owner":{"login":"tbelaire","id":427239,"avatar_url":"https://avatars.githubusercontent.com/u/427239?v=3","gravatar_id":"","url":"https://api.github.com/users/tbelaire","html_url":"https://github.com/tbelaire","followers_url":"https://api.github.com/users/tbelaire/followers","following_url":"https://api.github.com/users/tbelaire/following{/other_user}","gists_url":"https://api.github.com/users/tbelaire/gists{/gist_id}","starred_url":"https://api.github.com/users/tbelaire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbelaire/subscriptions","organizations_url":"https://api.github.com/users/tbelaire/orgs","repos_url":"https://api.github.com/users/tbelaire/repos","events_url":"https://api.github.com/users/tbelaire/events{/privacy}","received_events_url":"https://api.github.com/users/tbelaire/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tbelaire/rust","description":"a safe, concurrent, practical language","fork":true,"url":"https://api.github.com/repos/tbelaire/rust","forks_url":"https://api.github.com/repos/tbelaire/rust/forks","keys_url":"https://api.github.com/repos/tbelaire/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tbelaire/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tbelaire/rust/teams","hooks_url":"https://api.github.com/repos/tbelaire/rust/hooks","issue_events_url":"https://api.github.com/repos/tbelaire/rust/issues/events{/number}","events_url":"https://api.github.com/repos/tbelaire/rust/events","assignees_url":"https://api.github.com/repos/tbelaire/rust/assignees{/user}","branches_url":"https://api.github.com/repos/tbelaire/rust/branches{/branch}","tags_url":"https://api.github.com/repos/tbelaire/rust/tags","blobs_url":"https://api.github.com/repos/tbelaire/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tbelaire/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tbelaire/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/tbelaire/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tbelaire/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/tbelaire/rust/languages","stargazers_url":"https://api.github.com/repos/tbelaire/rust/stargazers","contributors_url":"https://api.github.com/repos/tbelaire/rust/contributors","subscribers_url":"https://api.github.com/repos/tbelaire/rust/subscribers","subscription_url":"https://api.github.com/repos/tbelaire/rust/subscription","commits_url":"https://api.github.com/repos/tbelaire/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/tbelaire/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/tbelaire/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/tbelaire/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/tbelaire/rust/contents/{+path}","compare_url":"https://api.github.com/repos/tbelaire/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tbelaire/rust/merges","archive_url":"https://api.github.com/repos/tbelaire/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tbelaire/rust/downloads","issues_url":"https://api.github.com/repos/tbelaire/rust/issues{/number}","pulls_url":"https://api.github.com/repos/tbelaire/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/tbelaire/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/tbelaire/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tbelaire/rust/labels{/name}","releases_url":"https://api.github.com/repos/tbelaire/rust/releases{/id}","created_at":"2015-04-12T05:06:21Z","updated_at":"2015-04-14T14:55:21Z","pushed_at":"2015-05-01T19:21:35Z","git_url":"git://github.com/tbelaire/rust.git","ssh_url":"git@github.com:tbelaire/rust.git","clone_url":"https://github.com/tbelaire/rust.git","svn_url":"https://github.com/tbelaire/rust","homepage":"http://www.rust-lang.org","size":282573,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"rust-lang:master","ref":"master","sha":"83263b48c39ef0e21cc9872191f4ce4877f4e05f","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":724712,"name":"rust","full_name":"rust-lang/rust","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rust","description":"a safe, concurrent, practical language","fork":false,"url":"https://api.github.com/repos/rust-lang/rust","forks_url":"https://api.github.com/repos/rust-lang/rust/forks","keys_url":"https://api.github.com/repos/rust-lang/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rust/teams","hooks_url":"https://api.github.com/repos/rust-lang/rust/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rust/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rust/events","assignees_url":"https://api.github.com/repos/rust-lang/rust/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rust/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rust/tags","blobs_url":"https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rust/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rust/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rust/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rust/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rust/subscription","commits_url":"https://api.github.com/repos/rust-lang/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rust/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rust/merges","archive_url":"https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rust/downloads","issues_url":"https://api.github.com/repos/rust-lang/rust/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rust/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rust/releases{/id}","created_at":"2010-06-16T20:39:03Z","updated_at":"2015-05-12T09:05:20Z","pushed_at":"2015-05-12T08:54:41Z","git_url":"git://github.com/rust-lang/rust.git","ssh_url":"git@github.com:rust-lang/rust.git","clone_url":"https://github.com/rust-lang/rust.git","svn_url":"https://github.com/rust-lang/rust","homepage":"http://www.rust-lang.org","size":647524,"stargazers_count":10775,"watchers_count":10775,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2104,"mirror_url":null,"open_issues_count":2010,"forks":2104,"open_issues":2010,"watchers":10775,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/24818"},"html":{"href":"https://github.com/rust-lang/rust/pull/24818"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/24818"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/24818/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/24818/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/24818/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/db9d01842450fe07f77ca97d9a68d105366f407e"}}}}