noop_proc_macro-0.3.0/.cargo_vcs_info.json0000644000000001121367312403000143020ustar00{ "git": { "sha1": "8c20bc579f63561372a2243d340cedb8c7f64a9d" } } noop_proc_macro-0.3.0/.gitignore010064400007650000024000000000361354607222500151050ustar0000000000000000/target **/*.rs.bk Cargo.lock noop_proc_macro-0.3.0/Cargo.toml0000644000000015431367312403000123110ustar00# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] edition = "2018" name = "noop_proc_macro" version = "0.3.0" authors = ["Luca Barbato "] description = "No-op proc_macro, literally does nothing" readme = "README.md" keywords = ["proc_macro", "noop"] license = "MIT" repository = "https://github.com/lu-zero/noop_proc_macro" [lib] test = false proc-macro = true noop_proc_macro-0.3.0/Cargo.toml.orig010064400007650000024000000005271367312400500160040ustar0000000000000000[package] name = "noop_proc_macro" version = "0.3.0" authors = ["Luca Barbato "] edition = "2018" description = "No-op proc_macro, literally does nothing" repository = "https://github.com/lu-zero/noop_proc_macro" readme = "README.md" keywords = ["proc_macro", "noop"] license = "MIT" [lib] proc-macro = true test = false noop_proc_macro-0.3.0/LICENSE010064400007650000024000000020551356145347400141330ustar0000000000000000MIT License Copyright (c) 2019 Luca Barbato Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. noop_proc_macro-0.3.0/README.md010064400007650000024000000007021367312375600144030ustar0000000000000000# NoOp proc macro NoOp mocks for `proc_macros` that you might want to make optional. ``` rust #[cfg(feature = "serde")] pub(crate) use serde_derive::{Serialize, Deserialize}; #[cfg(not(feature = "serde")] pub(crate) use noop_proc_macro::{Serialize, Deserialize}; ``` ## Supported `proc_macros` - [Serde](https://serde.rs) - [rust-hawktracer](https://github.com/AlexEne/rust_hawktracer) - [wasm_bindgen](https://github.com/rustwasm/wasm-bindgen) noop_proc_macro-0.3.0/src/lib.rs010064400007650000024000000014371367312375600150350ustar0000000000000000extern crate proc_macro; use proc_macro::*; #[proc_macro_derive(Serialize, attributes(serde))] pub fn serialize(_items: proc_macro::TokenStream) -> proc_macro::TokenStream { proc_macro::TokenStream::new() } #[proc_macro_derive(Deserialize, attributes(serde))] pub fn deserialize(_items: proc_macro::TokenStream) -> proc_macro::TokenStream { proc_macro::TokenStream::new() } #[proc_macro_attribute] pub fn hawktracer(_args: TokenStream, input: TokenStream) -> TokenStream { input } #[proc_macro] pub fn scoped_tracepoint(_item: TokenStream) -> TokenStream { TokenStream::new() } /// https://docs.rs/wasm-bindgen-macro/0.2.63/src/wasm_bindgen_macro/lib.rs.html#9-19 #[proc_macro_attribute] pub fn wasm_bindgen(_attr: TokenStream, input: TokenStream) -> TokenStream { input } noop_proc_macro-0.3.0/tests/serde.rs010064400007650000024000000003051356145347400157340ustar0000000000000000use noop_proc_macro::Deserialize; use noop_proc_macro::Serialize; #[derive(Serialize, Deserialize)] struct S { #[serde(default)] a: usize, } #[test] fn test() { let _ = S { a: 0 }; } noop_proc_macro-0.3.0/tests/wasm_bindgen.rs010064400007650000024000000001761367312375600172760ustar0000000000000000use noop_proc_macro::wasm_bindgen; #[wasm_bindgen] struct S { a: usize, } #[test] fn test() { let _ = S { a: 0 }; }