{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/22899","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/22899/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/22899/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/22899/events","html_url":"https://github.com/rust-lang/rust/pull/22899","id":59343905,"number":22899,"title":"Add #[allow_internal_unstable] to track stability for macros better.","user":{"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},"labels":[],"state":"open","locked":false,"assignee":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"milestone":null,"comments":14,"created_at":"2015-02-28T14:42:09Z","updated_at":"2015-03-02T11:10:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/22899","html_url":"https://github.com/rust-lang/rust/pull/22899","diff_url":"https://github.com/rust-lang/rust/pull/22899.diff","patch_url":"https://github.com/rust-lang/rust/pull/22899.patch"},"body":"Unstable items used in a macro expansion will now always trigger\r\nstability warnings, *unless* the unstable items are directly inside a\r\nmacro marked with `#[allow_internal_unstable]`. IOW, the compiler warns\r\nunless the span of the unstable item is a subspan of the definition of a\r\nmacro marked with that attribute.\r\n\r\nE.g.\r\n\r\n    #[allow_internal_unstable]\r\n    macro_rules! foo {\r\n        ($e: expr) => {{\r\n            $e;\r\n            unstable(); // no warning\r\n            only_called_by_foo!();\r\n        }}\r\n    }\r\n\r\n    macro_rules! only_called_by_foo {\r\n        () => { unstable() } // warning\r\n    }\r\n\r\n    foo!(unstable()) // warning\r\n\r\nThe unstable inside `foo` is fine, due to the attribute. But the\r\n`unstable` inside `only_called_by_foo` is not, since that macro doesn't\r\nhave the attribute, and the `unstable` passed into `foo` is also not\r\nfine since it isn't contained in the macro itself (that is, even though\r\nit is only used directly in the macro).\r\n\r\nIn the process this makes the stability tracking much more precise,\r\ne.g. previously `println!(\"{}\", unstable())` got no warning, but now it\r\ndoes. As such, this is a bug fix that may cause [breaking-change]s.\r\n\r\nThe attribute is definitely feature gated, since it explicitly allows\r\nside-stepping the feature gating system.\r\n\r\n---\r\n\r\nThis updates `thread_local!` macro to use the attribute, since it uses\r\nunstable features internally (initialising a struct with unstable\r\nfields)."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/76694426","html_url":"https://github.com/rust-lang/rust/pull/22899#issuecomment-76694426","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/22899","id":76694426,"user":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T11:10:51Z","updated_at":"2015-03-02T11:10:51Z","body":"```\r\n\r\n---- [run-pass] run-pass-fulldeps/plugin-args-1.rs stdout ----\r\n\t\r\nerror: auxiliary build of \"/Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs\" failed to compile: \r\nstatus: exit code: 101\r\ncommand: i686-apple-darwin/stage2/bin/rustc /Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs -L i686-apple-darwin/test/run-pass-fulldeps --target=i686-apple-darwin --crate-type=dylib -L i686-apple-darwin/test/run-pass-fulldeps/plugin-args-1.stage2-i686-apple-darwinlibaux -C prefer-dynamic --out-dir i686-apple-darwin/test/run-pass-fulldeps/plugin-args-1.stage2-i686-apple-darwinlibaux --cfg rtopt --cfg debug -O -L i686-apple-darwin/rt\r\nstdout:\r\n------------------------------------------\r\n\r\n------------------------------------------\r\nstderr:\r\n------------------------------------------\r\n/Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs:49:9: 49:53 error: this function takes 3 parameters but 2 parameters were supplied [E0061]\r\n/Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs:49         NormalTT(box Expander { args: args, }, None));\r\n                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nerror: aborting due to previous error\r\n\r\n------------------------------------------\r\n\r\nthread '[run-pass] run-pass-fulldeps/plugin-args-1.rs' panicked at 'explicit panic', /Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/compiletest/runtest.rs:1466\r\n\r\n\r\n---- [run-pass] run-pass-fulldeps/plugin-args-2.rs stdout ----\r\n\t\r\nerror: auxiliary build of \"/Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs\" failed to compile: \r\nstatus: exit code: 101\r\ncommand: i686-apple-darwin/stage2/bin/rustc /Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs -L i686-apple-darwin/test/run-pass-fulldeps --target=i686-apple-darwin --crate-type=dylib -L i686-apple-darwin/test/run-pass-fulldeps/plugin-args-2.stage2-i686-apple-darwinlibaux -C prefer-dynamic --out-dir i686-apple-darwin/test/run-pass-fulldeps/plugin-args-2.stage2-i686-apple-darwinlibaux --cfg rtopt --cfg debug -O -L i686-apple-darwin/rt\r\nstdout:\r\n------------------------------------------\r\n\r\n------------------------------------------\r\nstderr:\r\n------------------------------------------\r\n/Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs:49:9: 49:53 error: this function takes 3 parameters but 2 parameters were supplied [E0061]\r\n/Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs:49         NormalTT(box Expander { args: args, }, None));\r\n                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nerror: aborting due to previous error\r\n\r\n------------------------------------------\r\n\r\nthread '[run-pass] run-pass-fulldeps/plugin-args-2.rs' panicked at 'explicit panic', /Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/compiletest/runtest.rs:1466\r\n\r\n\r\n---- [run-pass] run-pass-fulldeps/plugin-args-3.rs stdout ----\r\n\t\r\nerror: auxiliary build of \"/Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs\" failed to compile: \r\nstatus: exit code: 101\r\ncommand: i686-apple-darwin/stage2/bin/rustc /Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs -L i686-apple-darwin/test/run-pass-fulldeps --target=i686-apple-darwin --crate-type=dylib -L i686-apple-darwin/test/run-pass-fulldeps/plugin-args-3.stage2-i686-apple-darwinlibaux -C prefer-dynamic --out-dir i686-apple-darwin/test/run-pass-fulldeps/plugin-args-3.stage2-i686-apple-darwinlibaux --cfg rtopt --cfg debug -O -L i686-apple-darwin/rt\r\nstdout:\r\n------------------------------------------\r\n\r\n------------------------------------------\r\nstderr:\r\n------------------------------------------\r\n/Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs:49:9: 49:53 error: this function takes 3 parameters but 2 parameters were supplied [E0061]\r\n/Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/test/auxiliary/plugin_args.rs:49         NormalTT(box Expander { args: args, }, None));\r\n                                                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nerror: aborting due to previous error\r\n\r\n------------------------------------------\r\n\r\nthread '[run-pass] run-pass-fulldeps/plugin-args-3.rs' panicked at 'explicit panic', /Users/rustbuild/src/rust-buildbot/slave/auto-mac-32-opt/build/src/compiletest/runtest.rs:1466\r\n\r\n\r\n\r\nfailures:\r\n    [run-pass] run-pass-fulldeps/plugin-args-1.rs\r\n    [run-pass] run-pass-fulldeps/plugin-args-2.rs\r\n    [run-pass] run-pass-fulldeps/plugin-args-3.rs\r\n```"}}