rust/src/libsyntax
Alex Crichton a9c1152c4b std: Add a new top-level thread_local module
This commit removes the `std::local_data` module in favor of a new
`std::thread_local` module providing thread local storage. The module provides
two variants of TLS: one which owns its contents and one which is based on
scoped references. Each implementation has pros and cons listed in the
documentation.

Both flavors have accessors through a function called `with` which yield a
reference to a closure provided. Both flavors also panic if a reference cannot
be yielded and provide a function to test whether an access would panic or not.
This is an implementation of [RFC 461][rfc] and full details can be found in
that RFC.

This is a breaking change due to the removal of the `std::local_data` module.
All users can migrate to the new thread local system like so:

    thread_local!(static FOO: Rc<RefCell<Option<T>>> = Rc::new(RefCell::new(None)))

The old `local_data` module inherently contained the `Rc<RefCell<Option<T>>>` as
an implementation detail which must now be explicitly stated by users.

[rfc]: https://github.com/rust-lang/rfcs/pull/461
[breaking-change]
2014-11-23 23:37:16 -08:00
..
ast_map auto merge of #19113 : nikomatsakis/rust/unboxed-boxed-closure-unification, r=acrichto 2014-11-20 12:01:44 +00:00
diagnostics std: Add a new top-level thread_local module 2014-11-23 23:37:16 -08:00
ext std: Add a new top-level thread_local module 2014-11-23 23:37:16 -08:00
parse std: Add a new top-level thread_local module 2014-11-23 23:37:16 -08:00
print rollup merge of #19215: aochagavia/pretty 2014-11-23 14:11:57 -05:00
util libsyntax: Add tests for parse_view_item 2014-11-17 20:26:21 -07:00
abi.rs Switch to purely namespaced enums 2014-11-17 07:35:51 -08:00
ast.rs Remove type parameters from ExprField and ExprTupField 2014-11-23 12:17:43 +01:00
ast_util.rs Feature gate non-ASCII lifetime identifiers 2014-11-18 23:07:14 +01:00
attr.rs std: Add a new top-level thread_local module 2014-11-23 23:37:16 -08:00
codemap.rs Fix an ICE on diagnostics originating in external macros 2014-11-20 21:31:59 +01:00
config.rs rustc: Process #[cfg]/#[cfg_attr] on crates 2014-11-07 12:04:28 -08:00
diagnostic.rs Fix an ICE on diagnostics originating in external macros 2014-11-20 21:31:59 +01:00
feature_gate.rs auto merge of #19113 : nikomatsakis/rust/unboxed-boxed-closure-unification, r=acrichto 2014-11-20 12:01:44 +00:00
fold.rs Remove type parameters from ExprField and ExprTupField 2014-11-23 12:17:43 +01:00
lib.rs removed usage of struct_variant feature as it is no longer gated 2014-11-20 00:21:32 +01:00
owned_slice.rs collections: Remove all collections traits 2014-11-01 11:37:04 -07:00
ptr.rs Remove a large amount of deprecated functionality 2014-10-19 12:59:40 -07:00
show_span.rs rebasing fixes 2014-09-17 16:53:20 +12:00
std_inject.rs Remove libnative 2014-11-20 17:19:13 -08:00
test.rs Switch to purely namespaced enums 2014-11-17 07:35:51 -08:00
visit.rs Remove type parameters from ExprField and ExprTupField 2014-11-23 12:17:43 +01:00