{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/25572736","id":25572736,"diff_hunk":"@@ -144,7 +151,10 @@ pub fn decode_inlined_item<'tcx>(cdata: &cstore::crate_metadata,\n             cdata: cdata,\n             tcx: tcx,\n             from_id_range: from_id_range,\n-            to_id_range: to_id_range\n+            to_id_range: to_id_range,\n+            translate_spans: cdata.codemap_import_info.len() > 0 &&","path":"src/librustc/middle/astencode.rs","position":43,"original_position":43,"commit_id":"855fe9ffc3bae7f5f31d7de3b71312cea0ee17b1","original_commit_id":"855fe9ffc3bae7f5f31d7de3b71312cea0ee17b1","user":{"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},"body":"would it be harmful to always translate spans? I don't understand why the first predicate would be false - is this for backwards compatibility with existing crates? If we do the translate work and it is unnecessary (second predicate) - is that a real waste of resources? Does if actually introduce an error?\r\n\r\nIn general, I like to avoid flags like this - I feel the increased scope for error outweighs the performance benefit. But if it is necessary, then leave it.","created_at":"2015-03-01T22:46:30Z","updated_at":"2015-03-01T22:46:30Z","html_url":"https://github.com/rust-lang/rust/pull/22235#discussion_r25572736","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/22235","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/25572736"},"html":{"href":"https://github.com/rust-lang/rust/pull/22235#discussion_r25572736"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/22235"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/22235","id":29208394,"html_url":"https://github.com/rust-lang/rust/pull/22235","diff_url":"https://github.com/rust-lang/rust/pull/22235.diff","patch_url":"https://github.com/rust-lang/rust/pull/22235.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/22235","number":22235,"state":"open","locked":false,"title":"Encode codemap and span information in crate metadata.","user":{"login":"michaelwoerister","id":1825894,"avatar_url":"https://avatars.githubusercontent.com/u/1825894?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelwoerister","html_url":"https://github.com/michaelwoerister","followers_url":"https://api.github.com/users/michaelwoerister/followers","following_url":"https://api.github.com/users/michaelwoerister/following{/other_user}","gists_url":"https://api.github.com/users/michaelwoerister/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelwoerister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelwoerister/subscriptions","organizations_url":"https://api.github.com/users/michaelwoerister/orgs","repos_url":"https://api.github.com/users/michaelwoerister/repos","events_url":"https://api.github.com/users/michaelwoerister/events{/privacy}","received_events_url":"https://api.github.com/users/michaelwoerister/received_events","type":"User","site_admin":false},"body":"This allows to create proper debuginfo line information for items inlined from other crates (e.g. instantiations of generics). Only the codemap's 'metadata' is stored in a crate's metadata. That is, just filename, positions of line-beginnings, etc. but not the actual source code itself.\r\n\r\nCrate metadata size is increased by this change because spans in the encoded ASTs take up space now:\r\n```\r\n                BEFORE    AFTER\r\nlibcore         36 MiB    39.6 MiB    +10%\r\nlibsyntax       51.1 MiB  60.5 MiB    +18.4%\r\nlibcollections  11.2 MiB  12.8 MiB    +14.3%\r\n```\r\nThis only affects binaries containing metadata (rlibs and dylibs), executables should not be affected in size. \r\n\r\nFixes #19228 and probably #22226.","created_at":"2015-02-12T19:28:52Z","updated_at":"2015-03-01T22:46:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28cbe264e1643ad7911e130cf63c0febc70da6f8","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/22235/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/22235/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/22235/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/855fe9ffc3bae7f5f31d7de3b71312cea0ee17b1","head":{"label":"michaelwoerister:cross-crate-spans","ref":"cross-crate-spans","sha":"855fe9ffc3bae7f5f31d7de3b71312cea0ee17b1","user":{"login":"michaelwoerister","id":1825894,"avatar_url":"https://avatars.githubusercontent.com/u/1825894?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelwoerister","html_url":"https://github.com/michaelwoerister","followers_url":"https://api.github.com/users/michaelwoerister/followers","following_url":"https://api.github.com/users/michaelwoerister/following{/other_user}","gists_url":"https://api.github.com/users/michaelwoerister/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelwoerister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelwoerister/subscriptions","organizations_url":"https://api.github.com/users/michaelwoerister/orgs","repos_url":"https://api.github.com/users/michaelwoerister/repos","events_url":"https://api.github.com/users/michaelwoerister/events{/privacy}","received_events_url":"https://api.github.com/users/michaelwoerister/received_events","type":"User","site_admin":false},"repo":{"id":9431220,"name":"rust","full_name":"michaelwoerister/rust","owner":{"login":"michaelwoerister","id":1825894,"avatar_url":"https://avatars.githubusercontent.com/u/1825894?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelwoerister","html_url":"https://github.com/michaelwoerister","followers_url":"https://api.github.com/users/michaelwoerister/followers","following_url":"https://api.github.com/users/michaelwoerister/following{/other_user}","gists_url":"https://api.github.com/users/michaelwoerister/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelwoerister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelwoerister/subscriptions","organizations_url":"https://api.github.com/users/michaelwoerister/orgs","repos_url":"https://api.github.com/users/michaelwoerister/repos","events_url":"https://api.github.com/users/michaelwoerister/events{/privacy}","received_events_url":"https://api.github.com/users/michaelwoerister/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michaelwoerister/rust","description":"a safe, concurrent, practical language","fork":true,"url":"https://api.github.com/repos/michaelwoerister/rust","forks_url":"https://api.github.com/repos/michaelwoerister/rust/forks","keys_url":"https://api.github.com/repos/michaelwoerister/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michaelwoerister/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michaelwoerister/rust/teams","hooks_url":"https://api.github.com/repos/michaelwoerister/rust/hooks","issue_events_url":"https://api.github.com/repos/michaelwoerister/rust/issues/events{/number}","events_url":"https://api.github.com/repos/michaelwoerister/rust/events","assignees_url":"https://api.github.com/repos/michaelwoerister/rust/assignees{/user}","branches_url":"https://api.github.com/repos/michaelwoerister/rust/branches{/branch}","tags_url":"https://api.github.com/repos/michaelwoerister/rust/tags","blobs_url":"https://api.github.com/repos/michaelwoerister/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michaelwoerister/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michaelwoerister/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/michaelwoerister/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michaelwoerister/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/michaelwoerister/rust/languages","stargazers_url":"https://api.github.com/repos/michaelwoerister/rust/stargazers","contributors_url":"https://api.github.com/repos/michaelwoerister/rust/contributors","subscribers_url":"https://api.github.com/repos/michaelwoerister/rust/subscribers","subscription_url":"https://api.github.com/repos/michaelwoerister/rust/subscription","commits_url":"https://api.github.com/repos/michaelwoerister/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/michaelwoerister/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/michaelwoerister/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/michaelwoerister/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/michaelwoerister/rust/contents/{+path}","compare_url":"https://api.github.com/repos/michaelwoerister/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michaelwoerister/rust/merges","archive_url":"https://api.github.com/repos/michaelwoerister/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michaelwoerister/rust/downloads","issues_url":"https://api.github.com/repos/michaelwoerister/rust/issues{/number}","pulls_url":"https://api.github.com/repos/michaelwoerister/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/michaelwoerister/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/michaelwoerister/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michaelwoerister/rust/labels{/name}","releases_url":"https://api.github.com/repos/michaelwoerister/rust/releases{/id}","created_at":"2013-04-14T15:57:02Z","updated_at":"2014-06-19T03:28:50Z","pushed_at":"2015-02-26T13:24:11Z","git_url":"git://github.com/michaelwoerister/rust.git","ssh_url":"git@github.com:michaelwoerister/rust.git","clone_url":"https://github.com/michaelwoerister/rust.git","svn_url":"https://github.com/michaelwoerister/rust","homepage":"http://www.rust-lang.org","size":243866,"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":"rust-lang:master","ref":"master","sha":"41f8b1e89b5ca0c79d7bca782ca44085624d4564","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-03-01T17:45:04Z","pushed_at":"2015-03-01T21:01:09Z","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":492367,"stargazers_count":9579,"watchers_count":9579,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1851,"mirror_url":null,"open_issues_count":1978,"forks":1851,"open_issues":1978,"watchers":9579,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/22235"},"html":{"href":"https://github.com/rust-lang/rust/pull/22235"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/22235"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/22235/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/22235/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/22235/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/855fe9ffc3bae7f5f31d7de3b71312cea0ee17b1"}}}}