Skip to content

Commit

Permalink
Make storage type aliases public to improve compile times.
Browse files Browse the repository at this point in the history
Private aliases to public types cause a significant performance
bottleneck in the privacy checking phase of compilation. Enable more
features in CI build scripts to ensure better test coverage. Part of #52.
  • Loading branch information
iliekturtles committed May 4, 2018
1 parent a06dad2 commit 39f4faa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ install:
## Build Script ##
build: false
test_script:
- cargo build --verbose --no-default-features --features "usize isize bigint rational bigrational f32 f64 si std use_serde"
- cargo test --verbose --no-run --no-default-features --features "usize isize bigint rational bigrational f32 f64 std use_serde"
- cargo test --all --verbose --features "use_serde"
- cargo build --verbose --no-default-features --features "autoconvert usize u8 u16 u32 u64 isize i8 i16 i32 i64 bigint biguint rational rational32 rational64 bigrational f32 f64 si std use_serde"
- cargo test --verbose --no-run --no-default-features --features "autoconvert usize u8 u16 u32 u64 isize i8 i16 i32 i64 bigint biguint rational rational32 rational64 bigrational f32 f64 si std use_serde"
- cargo test --all --verbose --no-default-features --features "autoconvert f32 f64 si std use_serde"

notifications:
- provider: Email
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ before_script: |
(test $(grep "cargo-travis" /home/travis/.cargo/.crates.toml | sed -r "s/\"cargo-travis ([^\ ]+).+/\1/") = $(cargo search cargo-travis --limit 1 | sed -r "s/cargo-travis \(([^\)]+)\).+/\1/") || cargoo install cargo-travis --force)
script: |
cargo build --verbose --no-default-features --features "usize isize bigint rational bigrational f32 f64 si std use_serde" &&
cargo test --verbose --no-run --no-default-features --features "usize isize bigint rational bigrational f32 f64 std use_serde" &&
cargo test --verbose --features "use_serde $TRAVIS_RUST_VERSION" &&
cargo build --verbose --no-default-features --features "autoconvert usize u8 u16 u32 u64 isize i8 i16 i32 i64 bigint biguint rational rational32 rational64 bigrational f32 f64 si std use_serde" &&
cargo test --verbose --no-run --no-default-features --features "autoconvert usize u8 u16 u32 u64 isize i8 i16 i32 i64 bigint biguint rational rational32 rational64 bigrational f32 f64 si std use_serde $TRAVIS_RUST_VERSION" &&
cargo test --verbose --no-default-features --features "autoconvert f32 f64 si std use_serde $TRAVIS_RUST_VERSION" &&
cargo test --manifest-path tests/feature_check/Cargo.toml --verbose --features "$TRAVIS_RUST_VERSION"
after_success: |
Expand Down
6 changes: 4 additions & 2 deletions src/storage_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,19 @@ macro_rules! storage_types {
(@mod ($(#[$attr:meta])*) $M:ident, $V:ty; ($($tt:tt)*)) => {
$(#[$attr])*
mod $M {
/// Storage type.
#[allow(dead_code)]
type V = $V;
pub type V = $V;

$($tt)*
}
};
(@pub_mod ($(#[$attr:meta])*) $M:ident, $V:ty; ($($tt:tt)*)) => {
$(#[$attr])*
pub mod $M {
/// Storage type.
#[allow(dead_code)]
type V = $V;
pub type V = $V;

$($tt)*
}
Expand Down

0 comments on commit 39f4faa

Please sign in to comment.