1[package]
2name = "auto_enums"
3version = "0.8.7" #publish:version
4edition = "2021"
5rust-version = "1.56" # For syn
6license = "Apache-2.0 OR MIT"
7repository = "https://github.com/taiki-e/auto_enums"
8keywords = ["enum", "macros", "derive", "attribute"]
9categories = ["no-std", "no-std::no-alloc", "rust-patterns"]
10exclude = ["/.*", "/tools", "/DEVELOPMENT.md"]
11description = """
12A library for to allow multiple return types by automatically generated enum.
13"""
14
15[package.metadata.docs.rs]
16all-features = true
17targets = ["x86_64-unknown-linux-gnu"]
18
19[lib]
20proc-macro = true
21
22[features]
23# Default features.
24default = ["std"]
25
26# Analyze return type of function and `let` binding.
27type_analysis = []
28
29# Enable to use `transpose*` methods.
30transpose_methods = []
31
32# ------------------------------------------------------------------------------
33# [std|core] libraries
34
35# Enable to use `std` library's traits.
36std = []
37# Enable to use `[std|core]::ops`'s `Deref`, `DerefMut`, `Index`, `IndexMut`, and `RangeBounds` traits.
38ops = []
39# Enable to use `[std|core]::convert`'s `AsRef` and `AsMut` traits.
40convert = []
41# Enable to use `[std|core]::fmt`'s traits other than `Debug`, `Display` and `Write`
42fmt = []
43
44# ------------------------------------------------------------------------------
45# Using external libraries
46
47# https://docs.rs/futures/0.3
48futures03 = []
49# https://docs.rs/futures/0.1
50futures01 = []
51# https://docs.rs/rayon/1
52rayon = []
53# https://docs.rs/serde/1
54serde = []
55# https://docs.rs/tokio/1
56tokio1 = []
57# https://docs.rs/tokio/0.3
58tokio03 = []
59# https://docs.rs/tokio/0.2
60tokio02 = []
61# https://docs.rs/tokio/0.1
62tokio01 = []
63# https://docs.rs/http-body/1
64http_body1 = []
65
66# ------------------------------------------------------------------------------
67# Unstable features
68# These features are outside of the normal semver guarantees and require the
69# `unstable` feature as an explicit opt-in to unstable API.
70unstable = []
71
72# Enable unstable features of [std|core] libraries
73
74# Enable to use `[std|core]::ops::Coroutine` trait.
75coroutine_trait = []
76generator_trait = ["coroutine_trait"] # alias for coroutine_trait; TODO: remove in the next breaking release
77# Enable to use `[std|core]::ops`'s `Fn`, `FnMut`, and `FnOnce` traits.
78fn_traits = []
79# Enable to use `[std|core]::iter::TrustedLen` trait.
80trusted_len = []
81
82# Note: futures, tokio, rayon, serde, and http-body are public dependencies.
83[dependencies]
84derive_utils = "0.15"
85proc-macro2 = "1.0.60"
86quote = "1.0.25"
87syn = { version = "2.0.1", default-features = false, features = ["parsing", "printing", "clone-impls", "proc-macro", "full", "visit-mut"] }
88
89[dev-dependencies]
90macrotest = { git = "https://github.com/taiki-e/macrotest.git", branch = "dev" } # adjust overwrite behavior + no cargo-expand
91rustversion = "1"
92trybuild = { git = "https://github.com/taiki-e/trybuild.git", branch = "dev" } # adjust overwrite behavior
93
94# for `#[enum_derive]`
95futures03_crate = { package = "futures-util", version = "0.3", default-features = false, features = ["std", "io", "sink"] }
96futures01_crate = { package = "futures", version = "0.1" }
97tokio1_crate = { package = "tokio", version = "1", default-features = false }
98tokio03_crate = { package = "tokio", version = "0.3", default-features = false }
99tokio02_crate = { package = "tokio", version = "0.2", default-features = false }
100tokio01_crate = { package = "tokio", version = "0.1", default-features = false, features = ["io"] }
101rayon_crate = { package = "rayon", version = "1" }
102serde_crate = { package = "serde", version = "1" }
103http_body1_crate = { package = "http-body", version = "1", default-features = false }
104
105[lints]
106workspace = true
107
108[workspace]
109resolver = "2"
110members = ["bench"]
111
112# This table is shared by projects under github.com/taiki-e.
113# It is not intended for manual editing.
114[workspace.lints.rust]
115deprecated_safe = "warn"
116improper_ctypes = "warn"
117improper_ctypes_definitions = "warn"
118non_ascii_idents = "warn"
119rust_2018_idioms = "warn"
120single_use_lifetimes = "warn"
121unexpected_cfgs = { level = "warn", check-cfg = [
122] }
123unnameable_types = "warn"
124unreachable_pub = "warn"
125# unsafe_op_in_unsafe_fn = "warn" # Set at crate-level instead since https://github.com/rust-lang/rust/pull/100081 is not available on MSRV
126[workspace.lints.clippy]
127all = "warn" # Downgrade deny-by-default lints
128pedantic = "warn"
129as_ptr_cast_mut = "warn"
130as_underscore = "warn"
131default_union_representation = "warn"
132inline_asm_x86_att_syntax = "warn"
133trailing_empty_array = "warn"
134transmute_undefined_repr = "warn"
135undocumented_unsafe_blocks = "warn"
136unused_trait_names = "warn"
137# Suppress buggy or noisy clippy lints
138bool_assert_comparison = { level = "allow", priority = 1 }
139borrow_as_ptr = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/8286
140cast_lossless = { level = "allow", priority = 1 } # https://godbolt.org/z/Pv6vbGG6E
141declare_interior_mutable_const = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7665
142doc_markdown = { level = "allow", priority = 1 }
143float_cmp = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7725
144incompatible_msrv = { level = "allow", priority = 1 } # buggy: doesn't consider cfg, https://github.com/rust-lang/rust-clippy/issues/12280, https://github.com/rust-lang/rust-clippy/issues/12257#issuecomment-2093667187
145lint_groups_priority = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/12920
146manual_assert = { level = "allow", priority = 1 }
147manual_range_contains = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/6455#issuecomment-1225966395
148missing_errors_doc = { level = "allow", priority = 1 }
149module_name_repetitions = { level = "allow", priority = 1 } # buggy: https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+module_name_repetitions
150naive_bytecount = { level = "allow", priority = 1 }
151nonminimal_bool = { level = "allow", priority = 1 } # buggy: https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+nonminimal_bool
152range_plus_one = { level = "allow", priority = 1 } # buggy: https://github.com/rust-lang/rust-clippy/issues?q=is%3Aissue+is%3Aopen+range_plus_one
153similar_names = { level = "allow", priority = 1 }
154single_match = { level = "allow", priority = 1 }
155single_match_else = { level = "allow", priority = 1 }
156struct_excessive_bools = { level = "allow", priority = 1 }
157struct_field_names = { level = "allow", priority = 1 }
158too_many_arguments = { level = "allow", priority = 1 }
159too_many_lines = { level = "allow", priority = 1 }
160type_complexity = { level = "allow", priority = 1 }
161unreadable_literal = { level = "allow", priority = 1 }
162