rust/src/libsyntax
Manish Goregaokar 9eb596ce8f 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).
2015-03-06 08:58:16 +05:30
..
ast_map std: Deprecate std::old_io::fs 2015-03-04 15:59:30 -08:00
diagnostics Change span_help calls to fileline_help where appropriate 2015-03-03 15:18:33 +02:00
ext Rollup merge of #22899 - huonw:macro-stability, r=alexcrichton 2015-03-06 08:58:16 +05:30
parse Rollup merge of #22764 - ivanradanov:fileline_help, r=huonw 2015-03-05 12:38:32 +05:30
print std: Deprecate std::old_io::fs 2015-03-04 15:59:30 -08:00
util Use arrays instead of vectors in tests 2015-02-24 21:15:45 +03:00
abi.rs Use consts instead of statics where appropriate 2015-03-02 17:11:51 +01:00
ast_util.rs Remove integer suffixes where the types in compiled code are identical. 2015-03-05 12:38:33 +05:30
ast.rs Add #[allow_internal_unstable] to track stability for macros better. 2015-03-06 00:18:28 +11:00
attr.rs Remove the re-exports for InlineAttr variants. 2015-02-28 13:56:32 +01:00
codemap.rs Add #[allow_internal_unstable] to track stability for macros better. 2015-03-06 00:18:28 +11:00
config.rs Replace all uses of &foo[] with &foo[..] en masse. 2015-02-18 17:36:03 -05:00
diagnostic.rs Switched to Box::new in many places. 2015-03-03 21:05:55 +01:00
feature_gate.rs Rollup merge of #22899 - huonw:macro-stability, r=alexcrichton 2015-03-06 08:58:16 +05:30
fold.rs std: Deprecate std::old_io::fs 2015-03-04 15:59:30 -08:00
lib.rs std: Deprecate std::old_io::fs 2015-03-04 15:59:30 -08:00
owned_slice.rs Switched to Box::new in many places. 2015-03-03 21:05:55 +01:00
ptr.rs Register new snapshots 2015-02-20 22:17:17 -08:00
show_span.rs std: Stabilize FromStr and parse 2015-01-30 08:52:44 -08:00
std_inject.rs Remove remaining uses of []. This time I tried to use deref coercions where possible. 2015-02-20 14:08:14 -05:00
test.rs Add #[allow_internal_unstable] to track stability for macros better. 2015-03-06 00:18:28 +11:00
visit.rs Implement <T>::method UFCS expression syntax. 2015-02-24 14:16:02 +02:00