Skip to content

Commit 6fbf1bc

Browse files
remove proc_macros feature + revamp of proc-macro modules
1 parent 5fdc807 commit 6fbf1bc

23 files changed

+702
-631
lines changed

Cargo.toml

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ path = "src/_lib.rs"
33

44
[package]
55
name = "safer-ffi"
6-
# Keep in sync with `[dependencies.proc_macro]` and `src/proc_macro/Cargo.toml`
7-
version = "0.0.5"
6+
version = "0.1.0" # Keep in sync
87
authors = ["Daniel Henry-Mantilla <[email protected]>"]
9-
edition = "2018"
8+
edition = "2021"
109

1110
description = "Write safer FFI code in Rust without polluting it with unsafe code"
1211
keywords = ["ffi", "no_std", "framework", "safety", "bindings"]
@@ -19,42 +18,50 @@ readme = "README.md"
1918
default = [
2019
"std",
2120
# FIXME: REMOVE!
22-
"dyn-traits"
21+
"dyn-traits",
22+
]
23+
24+
# Document under the following features: all but for debug or experimental.
25+
docs = [
26+
"default",
27+
"nightly",
28+
"uninit",
2329
]
2430

2531
nightly = []
2632

2733
alloc = []
28-
std = [ "alloc" ]
34+
std = [
35+
"alloc",
36+
]
37+
38+
# Deprecated
39+
proc_macros = []
2940

3041
async-fn = [
3142
"safer_ffi-proc_macros/async-fn",
3243
]
3344

34-
derives = ["proc_macros"] # alias
35-
proc_macros = [
36-
"safer_ffi-proc_macros/proc_macros",
37-
"require_unsafe_in_body",
38-
"proc-macro-hack",
39-
]
4045
debug_proc_macros = [
41-
"proc_macros",
4246
"safer_ffi-proc_macros/verbose-expansions",
4347
]
4448

4549
dyn-traits = [
46-
"proc_macros",
4750
"safer_ffi-proc_macros/dyn-traits",
4851
]
4952

50-
out-refs = ["uninit"]
53+
out-refs = [
54+
"uninit",
55+
]
5156

5257
headers = [
5358
"inventory",
5459
"safer_ffi-proc_macros/headers",
5560
"std",
5661
]
57-
csharp-headers = ["headers"]
62+
csharp-headers = [
63+
"headers",
64+
]
5865

5966
node-js = [
6067
"async-fn",
@@ -64,23 +71,23 @@ node-js = [
6471
# "napi-derive",
6572
"safer_ffi-proc_macros/node-js",
6673
# For convenience
67-
"proc_macros", "std",
74+
"std",
6875
]
6976

7077
[dev-dependencies]
71-
macro_rules_attribute = "0.0.1"
78+
macro_rules_attribute = "0.1.0"
7279

7380
[target.'cfg(not(target = "wasm32-unknown-unknown"))'.dependencies]
7481
libc = { version = "0.2.66", default-features = false }
7582

7683
[dependencies]
7784
paste = { package = "mini_paste", version = "0.1.*" }
78-
log = { version = "0.4.8", optional = true }
79-
require_unsafe_in_body = { version = "0.2.1", optional = true }
80-
inventory = { version = "0.1.6", optional = true }
81-
proc-macro-hack = { version = "0.5.15", optional = true }
82-
unwind_safe = "0.0.1"
83-
scopeguard = "1.1.0"
85+
log.version = "0.4.8"
86+
log.optional = true
87+
inventory.version = "0.1.6"
88+
inventory.optional = true
89+
scopeguard.version = "1.1.0"
90+
unwind_safe.version = "0.1.0"
8491

8592
[dependencies.napi]
8693
package = "napi-dispatcher"
@@ -95,9 +102,8 @@ path = "napi-dispatcher"
95102
# branch = "ditto/closure-into-jsfunction"
96103

97104
[dependencies.safer_ffi-proc_macros]
98-
# package = "safer_ffi-proc_macros"
99105
path = "src/proc_macro"
100-
version = "0.0.5"
106+
version = "0.1.0-rc1" # Keep in sync
101107

102108
[dependencies.uninit]
103109
optional = true
@@ -118,5 +124,5 @@ members = [
118124
]
119125

120126
[package.metadata.docs.rs]
121-
all-features = true
122-
rustdoc-args = ["--cfg", "docs"]
127+
features = ["docs"]
128+
# rustdoc-args = ["--cfg", "docs"]

ffi_tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ edition = "2018"
1515

1616
[dependencies.safer-ffi]
1717
path = ".."
18-
features = ["async-fn", "proc_macros"]
18+
features = ["async-fn"]
1919

2020
[features]
2121
generate-headers = ["safer-ffi/csharp-headers"]

ffi_tests/tests/csharp/Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>netcoreapp5.0</TargetFramework>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
</PropertyGroup>
88

js_tests/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ futures = "0.3.15"
2020
path = ".."
2121
features = [
2222
# "debug_proc_macros",
23-
"proc_macros",
2423
"out-refs",
2524
]
2625

0 commit comments

Comments
 (0)