{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/25520","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/25520/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/25520/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/25520/events","html_url":"https://github.com/rust-lang/rust/pull/25520","id":77220811,"number":25520,"title":"Clarify macro backtraces","user":{"login":"P1start","id":2055302,"avatar_url":"https://avatars.githubusercontent.com/u/2055302?v=3","gravatar_id":"","url":"https://api.github.com/users/P1start","html_url":"https://github.com/P1start","followers_url":"https://api.github.com/users/P1start/followers","following_url":"https://api.github.com/users/P1start/following{/other_user}","gists_url":"https://api.github.com/users/P1start/gists{/gist_id}","starred_url":"https://api.github.com/users/P1start/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P1start/subscriptions","organizations_url":"https://api.github.com/users/P1start/orgs","repos_url":"https://api.github.com/users/P1start/repos","events_url":"https://api.github.com/users/P1start/events{/privacy}","received_events_url":"https://api.github.com/users/P1start/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"huonw","id":1203825,"avatar_url":"https://avatars.githubusercontent.com/u/1203825?v=3","gravatar_id":"","url":"https://api.github.com/users/huonw","html_url":"https://github.com/huonw","followers_url":"https://api.github.com/users/huonw/followers","following_url":"https://api.github.com/users/huonw/following{/other_user}","gists_url":"https://api.github.com/users/huonw/gists{/gist_id}","starred_url":"https://api.github.com/users/huonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huonw/subscriptions","organizations_url":"https://api.github.com/users/huonw/orgs","repos_url":"https://api.github.com/users/huonw/repos","events_url":"https://api.github.com/users/huonw/events{/privacy}","received_events_url":"https://api.github.com/users/huonw/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-05-17T05:25:10Z","updated_at":"2015-05-19T00:52:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/25520","html_url":"https://github.com/rust-lang/rust/pull/25520","diff_url":"https://github.com/rust-lang/rust/pull/25520.diff","patch_url":"https://github.com/rust-lang/rust/pull/25520.patch"},"body":"Currently, macro backtraces look like this:\r\n\r\n    <anon>:4:10: 4:13 error: unresolved name `bar`\r\n    <anon>:4     foo!(bar);\r\n                      ^~~\r\n    <anon>:1:1: 1:42 note: in expansion of foo!\r\n    <anon>:4:5: 4:15 note: expansion site\r\n\r\nThis is somewhat unclear, as it’s not immediately obvious where the expansion site or the definition of `foo!` is. This changes these backtraces to look like this:\r\n\r\n    <anon>:4:10: 4:13 error: unresolved name `bar`\r\n    <anon>:4     foo!(bar);\r\n                      ^~~\r\n    note: in expansion of `foo!`, defined at <anon>:1:1: 1:42\r\n    note: expansion site: <anon>:4:5: 4:15\r\n\r\nSince backtraces no longer outupt spans in the normal manner, this also modifies compiletest to support testing for span-less errors using `@` and `<>`; for example, to test for the backtrace above, one would write something like this:\r\n\r\n```rust\r\nmacro_rules! foo { ($e: expr) => { ... } } //~@ NOTE in expansion of `foo`, defined at <>\r\nfoo!(bar); //~ ERROR unresolved name `bar`\r\n//~^@ NOTE expansion site: <>\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/103285169","html_url":"https://github.com/rust-lang/rust/pull/25520#issuecomment-103285169","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/25520","id":103285169,"user":{"login":"brson","id":147214,"avatar_url":"https://avatars.githubusercontent.com/u/147214?v=3","gravatar_id":"","url":"https://api.github.com/users/brson","html_url":"https://github.com/brson","followers_url":"https://api.github.com/users/brson/followers","following_url":"https://api.github.com/users/brson/following{/other_user}","gists_url":"https://api.github.com/users/brson/gists{/gist_id}","starred_url":"https://api.github.com/users/brson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brson/subscriptions","organizations_url":"https://api.github.com/users/brson/orgs","repos_url":"https://api.github.com/users/brson/repos","events_url":"https://api.github.com/users/brson/events{/privacy}","received_events_url":"https://api.github.com/users/brson/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T00:52:02Z","updated_at":"2015-05-19T00:52:02Z","body":"I like the change to the output, but I'm wondering if the new testing infrastructure is necessary. Could compiletest try to interpret a `//~` comment in both ways? Seems like a false-positive is pretty unlikely."}}