rust/src/librustc/middle
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
..
cfg Implement <T>::method UFCS expression syntax. 2015-02-24 14:16:02 +02:00
infer Rollup merge of #22764 - ivanradanov:fileline_help, r=huonw 2015-03-05 12:38:32 +05:30
traits Address nits by @nrc. 2015-03-05 05:46:12 -05:00
astconv_util.rs remove some compiler warnings 2015-02-26 07:21:26 +02:00
astencode.rs Encode codemap and span information in crate metadata. 2015-03-04 09:50:09 +01:00
check_const.rs Address arith-overflow and error-handling in const_eval.rs. 2015-03-03 12:10:57 +01:00
check_loop.rs
check_match.rs Rollup merge of #22764 - ivanradanov:fileline_help, r=huonw 2015-03-05 12:38:32 +05:30
check_rvalues.rs
check_static_recursion.rs Implement <T>::method UFCS expression syntax. 2015-02-24 14:16:02 +02:00
const_eval.rs Remove integer suffixes where the types in compiled code are identical. 2015-03-05 12:38:33 +05:30
dataflow.rs std: Deprecate std::old_io::fs 2015-03-04 15:59:30 -08:00
dead.rs rustc: combine partial_def_map and last_private_map into def_map. 2015-02-24 14:16:02 +02:00
def.rs rustc: combine partial_def_map and last_private_map into def_map. 2015-02-24 14:16:02 +02:00
dependency_format.rs
effect.rs Implement <T>::method UFCS expression syntax. 2015-02-24 14:16:02 +02:00
entry.rs
expr_use_visitor.rs Implement <T>::method UFCS expression syntax. 2015-02-24 14:16:02 +02:00
fast_reject.rs Remove the synthetic "region bound" from closures and instead update how 2015-03-02 05:45:41 -05:00
graph.rs
intrinsicck.rs
lang_items.rs core: Audit num module for int/uint 2015-03-02 16:12:46 -08:00
liveness.rs Rollup merge of #22876 - Florob:const, r=nikomatsakis 2015-03-03 17:02:20 +05:30
mem_categorization.rs Remove the synthetic "region bound" from closures and instead update how 2015-03-02 05:45:41 -05:00
pat_util.rs rustc: combine partial_def_map and last_private_map into def_map. 2015-02-24 14:16:02 +02:00
privacy.rs rustc: combine partial_def_map and last_private_map into def_map. 2015-02-24 14:16:02 +02:00
reachable.rs Implement <T>::method UFCS expression syntax. 2015-02-24 14:16:02 +02:00
recursion_limit.rs
region.rs Remove the synthetic "region bound" from closures and instead update how 2015-03-02 05:45:41 -05:00
resolve_lifetime.rs Implement <T>::method UFCS expression syntax. 2015-02-24 14:16:02 +02:00
stability.rs Add #[allow_internal_unstable] to track stability for macros better. 2015-03-06 00:18:28 +11:00
subst.rs
ty_fold.rs Generalize the code so we can handle multiple supertraits. 2015-03-04 15:06:33 -05:00
ty_walk.rs Remove the synthetic "region bound" from closures and instead update how 2015-03-02 05:45:41 -05:00
ty.rs Address nits by @nrc. 2015-03-05 05:46:12 -05:00
weak_lang_items.rs