Skip to content

Commit ed849ab

Browse files
bors[bot]jean-airoldiecuviper
authored
Merge #35
35: Add `num_traits` proc_macro helper for explicit import r=cuviper a=jean-airoldie This allows the user to specify a identifier for the `num_traits` crate so that the proc_macros can directly depend in it. This is usefull when reexporting `num-derive` and using `num-trait` as a transitive import. Fixes #34. CC. @vglavnyy Co-authored-by: jean-airoldie <[email protected]> Co-authored-by: Josh Stone <[email protected]>
2 parents bafa54c + 90c8ad8 commit ed849ab

File tree

8 files changed

+414
-314
lines changed

8 files changed

+414
-314
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
command: build
5050
# This test crate is intentionally separate, because we need
5151
# independent features for no-std. (rust-lang/cargo#2589)
52-
args: --target thumbv6m-none-eabi --manifest-path check/Cargo.toml
52+
args: --target thumbv6m-none-eabi --manifest-path ci/check/Cargo.toml
5353

5454
fmt:
5555
name: Format

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ quote = "1"
1919
syn = "1"
2020

2121
[dev-dependencies]
22-
num = "0.2"
22+
num = "0.3"
2323
num-traits = "0.2"
2424

2525
[features]

check/Cargo.toml renamed to ci/check/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors = ["Josh Stone <[email protected]>"]
55
edition = "2018"
66

77
[dependencies.num-derive]
8-
path = ".."
8+
path = "../.."
99

1010
[dependencies.num-traits]
1111
version = "0.2"
File renamed without changes.

ci/import/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "import"
3+
version = "0.0.1"
4+
authors = ["jean-airoldie <[email protected]>"]
5+
edition = "2018"
6+
publish = false
7+
8+
[dependencies]
9+
num-derive = { path = "../.." }
10+
num = { version = "0.3", default-features = false }

ci/import/src/lib.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#[macro_use]
2+
extern crate num_derive;
3+
4+
#[derive(
5+
Debug,
6+
Clone,
7+
Copy,
8+
PartialEq,
9+
PartialOrd,
10+
ToPrimitive,
11+
FromPrimitive,
12+
)]
13+
#[num_traits = "num"]
14+
#[repr(u8)]
15+
enum Rgb {
16+
Red = 0,
17+
Green = 1,
18+
Black = 2,
19+
}

ci/test_full.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ done
4545
# test all supported features
4646
cargo build --features="${FEATURES[*]}"
4747
cargo test --features="${FEATURES[*]}"
48+
49+
# these CI crates keep tighter control over dependencies
50+
cargo check --verbose --manifest-path ci/check/Cargo.toml
51+
cargo check --verbose --manifest-path ci/import/Cargo.toml

0 commit comments

Comments
 (0)