I'm writing a procedural macro that produces some typenum
types, and I'd like to test an ability to override which copy of typenum
its output uses (in case there are multiple versions linked).
Following the instructions in the Cargo Book to rename a dependency, my Cargo.toml
looks like this:
[package]
name = "typenum-uuid"
version = "0.1.0"
authors = ["e"]
edition = "2018"
[lib]
proc_macro = true
[dependencies]
uuid = { version = "0.8", features = [ "v4" ] }
[dev-dependencies]
typenum = "=1.0.0"
tn128 = { package = "typenum", version = "^1.12.0", features = [ "i128" ] }
And produces this error:
$ cargo test
Updating crates.io index
error: failed to select a version for `typenum`.
... required by package `typenum-uuid v0.1.0 (/home/e/Workbench/rust/typenum-uuid)`
versions that meet the requirements `=1.0.0` are: 1.0.0
all possible versions conflict with previously selected packages.
previously selected package `typenum v1.12.0`
... which is depended on by `typenum-uuid v0.1.0 (/home/e/Workbench/rust/typenum-uuid)`
failed to select a version for `typenum` which could resolve this conflict
Is there a way to force Cargo to duplicate the dependency with multiple names like I want?