lazy_attribute/
lib.rs

1#![warn(missing_docs)]
2#![doc = include_str!("lib.md")]
3
4//--------------------------------------------------------------------------------------------------
5// Extern Crates
6//--------------------------------------------------------------------------------------------------
7
8// This is needed for the macro to work in tests: https://github.com/bkchr/proc-macro-crate/issues/10#issuecomment-826382619
9extern crate self as lazy_attribute;
10
11//--------------------------------------------------------------------------------------------------
12// Exports
13//--------------------------------------------------------------------------------------------------
14
15#[doc = include_str!("lazy_ref.md")]
16pub use lazy_attribute_core::lazy_ref;
17
18//--------------------------------------------------------------------------------------------------
19// Re-export Modules
20//--------------------------------------------------------------------------------------------------
21
22#[doc(hidden)]
23pub mod __internal {
24    #[cfg(feature = "async")]
25    pub use async_once_cell;
26    pub use once_cell;
27}
28
29//--------------------------------------------------------------------------------------------------
30// Tests
31//--------------------------------------------------------------------------------------------------
32
33#[cfg(test)]
34mod test {
35    #[test]
36    fn lazy() {
37        let t = trybuild::TestCases::new();
38
39        t.pass("test/01-correct-func.rs");
40        #[cfg(feature = "async")]
41        t.pass("test/02-correct-async-func.rs");
42        t.compile_fail("test/03-unsupported-args.rs");
43    }
44}