]>
Commit | Line | Data |
---|---|---|
54a0048b | 1 | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT |
223e47cc LB |
2 | // file at the top-level directory of this distribution and at |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
b7449926 | 11 | // run-pass |
3157f602 XL |
12 | #![deny(missing_docs)] |
13 | //! this tests the syntax of `thread_local!` | |
a7813a04 | 14 | |
041b39d2 XL |
15 | mod foo { |
16 | mod bar { | |
17 | thread_local! { | |
18 | // no docs | |
19 | #[allow(unused)] | |
20 | static FOO: i32 = 42; | |
21 | /// docs | |
22 | pub static BAR: String = String::from("bar"); | |
23 | ||
24 | // look at these restrictions!! | |
25 | pub(crate) static BAZ: usize = 0; | |
26 | pub(in foo) static QUUX: usize = 0; | |
27 | } | |
28 | thread_local!(static SPLOK: u32 = 0); | |
29 | } | |
223e47cc | 30 | } |
3157f602 XL |
31 | |
32 | fn main() {} |