about summary refs log tree commit diff
path: root/src/rustllvm/ExecutionEngineWrapper.cpp
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-03-06 08:58:16 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-03-06 08:58:16 +0530
commit9eb596ce8f4b70ba73e8671f9b42147c91319842 (patch)
tree8352c13275ef5db66a0a2cf48c98e5f690a37d6e /src/rustllvm/ExecutionEngineWrapper.cpp
parente80fc10af19b1c9c4507187ab1c059b445d8f057 (diff)
parentb5c6ab20b7d1f4d6b0cc31c2987b2e0f8ea43e0c (diff)
downloadrust-9eb596ce8f4b70ba73e8671f9b42147c91319842.tar.gz
rust-9eb596ce8f4b70ba73e8671f9b42147c91319842.zip
Rollup merge of #22899 - huonw:macro-stability, r=alexcrichton
 Unstable items used in a macro expansion will now always trigger
stability warnings, *unless* the unstable items are directly inside a
macro marked with `#[allow_internal_unstable]`. IOW, the compiler warns
unless the span of the unstable item is a subspan of the definition of a
macro marked with that attribute.

E.g.

    #[allow_internal_unstable]
    macro_rules! foo {
        ($e: expr) => {{
            $e;
            unstable(); // no warning
            only_called_by_foo!();
        }}
    }

    macro_rules! only_called_by_foo {
        () => { unstable() } // warning
    }

    foo!(unstable()) // warning

The unstable inside `foo` is fine, due to the attribute. But the
`unstable` inside `only_called_by_foo` is not, since that macro doesn't
have the attribute, and the `unstable` passed into `foo` is also not
fine since it isn't contained in the macro itself (that is, even though
it is only used directly in the macro).

In the process this makes the stability tracking much more precise,
e.g. previously `println!(\"{}\", unstable())` got no warning, but now it
does. As such, this is a bug fix that may cause [breaking-change]s.

The attribute is definitely feature gated, since it explicitly allows
side-stepping the feature gating system.

---

This updates `thread_local!` macro to use the attribute, since it uses
unstable features internally (initialising a struct with unstable
fields).
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions