1 //! [](https://github.com/nvzqz/static-assertions-rs) 2 //! 3 //! <div align="center"> 4 //! <a href="https://crates.io/crates/proc_static_assertions"> 5 //! <img src="https://img.shields.io/crates/d/proc_static_assertions.svg" alt="Downloads"> 6 //! </a> 7 //! <a href="https://travis-ci.org/nvzqz/static-assertions-rs"> 8 //! <img src="https://travis-ci.org/nvzqz/static-assertions-rs.svg?branch=master" alt="Build Status"> 9 //! </a> 10 //! <br><br> 11 //! </div> 12 //! 13 //! Procedural macro [compile-time] assertions as an extension of 14 //! [`static_assertions`]. 15 //! 16 //! # Usage 17 //! 18 //! There's two main ways of using this crate: as a direct dependency or 19 //! indirect dependency (via [`static_assertions`]). 20 //! 21 //! ## Direct Dependency 22 //! 23 //! This crate is available [on crates.io][crate] and can be used by adding the 24 //! following to your project's [`Cargo.toml`]: 25 //! 26 //! ```toml 27 //! [dependencies] 28 //! proc_static_assertions = "0.0.0" 29 //! ``` 30 //! 31 //! and this to your crate root (`main.rs` or `lib.rs`): 32 //! 33 //! ``` 34 //! #[macro_use] 35 //! extern crate proc_static_assertions; 36 //! # fn main() {} 37 //! ``` 38 //! 39 //! ## Indirect Dependency 40 //! 41 //! Add the following to your project's [`Cargo.toml`]: 42 //! 43 //! ```toml 44 //! [dependencies] 45 //! static_assertions = { version = "1.1.0", features = ["proc"] } 46 //! ``` 47 //! 48 //! and this to your crate root (`main.rs` or `lib.rs`): 49 //! 50 //! ```ignore 51 //! #[macro_use] 52 //! extern crate static_assertions; 53 //! ``` 54 //! 55 //! This will also import all macros in `proc_static_assertions`. 56 //! 57 //! # Donate 58 //! 59 //! This project is made freely available (as in free beer), but unfortunately 60 //! not all beer is free! So, if you would like to buy me a beer (or coffee or 61 //! *more*), then consider supporting my work that's benefited your project 62 //! and thousands of others. 63 //! 64 //! <a href="https://www.patreon.com/nvzqz"> 65 //! <img src="https://c5.patreon.com/external/logo/become_a_patron_button.png" alt="Become a Patron!" height="35"> 66 //! </a> 67 //! <a href="https://www.paypal.me/nvzqz"> 68 //! <img src="https://buymecoffee.intm.org/img/button-paypal-white.png" alt="Buy me a coffee" height="35"> 69 //! </a> 70 //! 71 //! [`static_assertions`]: https://github.com/nvzqz/static-assertions-rs 72 //! [crate]: https://crates.io/crates/static_assertions 73 //! [`Cargo.toml`]: https://doc.rust-lang.org/cargo/reference/manifest.html 74 //! [compile-time]: https://en.wikipedia.org/wiki/Compile_time 75 76 #![doc(html_root_url = "https://docs.rs/proc_static_assertions/0.0.0")] 77 #![doc( 78 html_logo_url = "https://raw.githubusercontent.com/nvzqz/static-assertions-rs/assets/Icon.png" 79 )] 80 #![deny(missing_docs)] 81 82 extern crate proc_macro; 83 use proc_macro::TokenStream; 84 85 /// Statically assert aspects of types, traits, and more. 86 /// 87 /// This currently does nothing. Create an issue if you have ideas for what this 88 /// could do! 89 #[proc_macro_attribute] assert(_attr: TokenStream, _item: TokenStream) -> TokenStream90pub fn assert(_attr: TokenStream, _item: TokenStream) -> TokenStream { 91 TokenStream::new() 92 } 93