diff options
| author | Alex Burka <durka42+github@gmail.com> | 2016-06-04 15:19:22 -0400 |
|---|---|---|
| committer | Alex Burka <aburka@seas.upenn.edu> | 2016-06-22 20:29:37 -0400 |
| commit | fc28ee256a851b4274a2f8c8f776197f81bc7f07 (patch) | |
| tree | 69a6d9912105a69ca5e646885631e07c050235db /src/test | |
| parent | fe96928d7de991e527a7ed7b88bb30aa965c8a08 (diff) | |
upgrade thread_local! invocation syntax
Allows declaring multiple statics in one macro invocation, and supports attaching attributes to the generated items.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/thread-local-syntax.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/run-pass/thread-local-syntax.rs b/src/test/run-pass/thread-local-syntax.rs new file mode 100644 index 00000000000..a5967249b54 --- /dev/null +++ b/src/test/run-pass/thread-local-syntax.rs @@ -0,0 +1,23 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(missing_docs)] +//! this tests the syntax of `thread_local!` + +thread_local! { + // no docs + #[allow(unused)] + static FOO: i32 = 42; + /// docs + pub static BAR: String = String::from("bar"); +} +thread_local!(static BAZ: u32 = 0); + +fn main() {} |
