-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Description
For complicated reasons, I am ending up running proc_macro_crate on a package whose Cargo.toml looks like this:
package = { name = "derive-deftly-tests-tests", version = "0.0.0", publish = false, edition = "2021" }
features = { beta = ["derive-deftly-tests/beta"], case = ["derive-deftly-tests/case"], default = ["derive-deftly-tests/default"], full = ["derive-deftly-tests/full"], meta-as-expr = ["derive-deftly-tests/meta-as-expr"], meta-as-items = ["derive-deftly-tests/meta-as-items"], recent = ["derive-deftly-tests/recent"], ui = ["derive-deftly-tests/ui"] }
dependencies = { derive-deftly = { version = "*", path = "/volatile/rustcargo/Rustup/Derive-Deftly/derive-deftly/tests/..", default-features = false, features = ["minimal-1"] }, derive-deftly-tests = { path = "/volatile/rustcargo/Rustup/Derive-Deftly/derive-deftly/tests", default-features = false }, easy-ext = { version = "1" }, educe = { version = ">=0.4.6, <0.7" }, glob = { version = "0.3" }, heck = { version = ">=0.4, <0.6" }, indexmap = { version = ">=1.8, <3" }, itertools = { version = ">=0.10.1, <0.16" }, paste = { version = "1" }, proc-macro-crate = { path = "/home/ian/Rustup/Derive-Deftly/proc-macro-crate" }, proc-macro2 = { version = "1.0.53" }, quote = { version = "1" }, regex = { version = "1" }, sha3 = { version = "0.10" }, static_assertions = { version = "1" }, strum = { version = ">=0.24, <0.28", features = ["derive"] }, syn = { version = "2.0.53", features = ["extra-traits", "full"] }, toml = { version = ">=0.5.0, <0.9" }, trybuild = { version = "1.0.46" }, void = { version = "1" } }
bin = [{ name = "derive-deftly-tests-tests", path = "main.rs" }, { name = "macrotest001", path = "/volatile/rustcargo/Rustup/Derive-Deftly/derive-deftly/tests/expand/clone.rs" }]
workspace = {}
This fails, because the code in proc_macro_crate uses Item::as_table to look up table values. Item::as_table returns None for Item::Value(Value::InlineTable(..)).
The proper call with toml_edit is as_table_like. I will prepare an MR for that.
Other ways of addressing this might be to switch to a different toml library altogether - #56, #37
Metadata
Metadata
Assignees
Labels
No labels