Skip to content

Commit bdd7edc

Browse files
authored
Merge pull request #2088 from nnethercote/add-typenum
Add `typenum-1.18.0` benchmark
2 parents 984c61e + b391852 commit bdd7edc

36 files changed

+19420
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
diff --git a/typenum-1.18.0/src/lib.rs b/typenum-1.18.0/src/lib.rs
2+
index f7a1241a..13582037 100644
3+
--- a/typenum-1.18.0/src/lib.rs
4+
+++ b/typenum-1.18.0/src/lib.rs
5+
@@ -173,3 +173,4 @@ mod sealed {
6+
impl Sealed for ATerm {}
7+
impl<V, A> Sealed for TArr<V, A> {}
8+
}
9+
+fn foo() { let a = 5; }

collector/compile-benchmarks/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ They mostly consist of real-world crates.
5656
ecosystem.
5757
- **typenum-1.17.0**: A library that encodes integer computation within the trait system. Serves as
5858
a stress test for the trait solver, but at the same time it is also a very popular crate.
59+
- **typenum-1.18.0**: A library that encodes integer computation within the trait system. Serves as
60+
a stress test for the trait solver, but at the same time it is also a very popular crate.
5961
- **unicode-normalization-0.1.19**: Unicode character composition and decomposition
6062
utilities. Uses huge `match` statements that stress the compiler in unusual
6163
ways.

collector/compile-benchmarks/REUSE.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ path = "typenum-1.17.0/**"
279279
SPDX-FileCopyrightText = "typenum contributors"
280280
SPDX-License-Identifier = "MIT OR Apache-2.0"
281281

282+
[[annotations]]
283+
path = "typenum-1.18.0/**"
284+
SPDX-FileCopyrightText = "typenum contributors"
285+
SPDX-License-Identifier = "MIT OR Apache-2.0"
286+
282287
[[annotations]]
283288
path = "ucd/**"
284289
SPDX-FileCopyrightText = "ucd contributors"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"git": {
3+
"sha1": "67584b536d97c5503fa0f8d6ea1162eb4d9b8383"
4+
},
5+
"path_in_vcs": ""
6+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
branches:
7+
- main
8+
9+
name: CI
10+
11+
jobs:
12+
all-succeeded:
13+
name: All Succeeded
14+
if: always()
15+
runs-on: ubuntu-latest
16+
needs:
17+
- test-linux
18+
- test-non-linux
19+
- lint
20+
21+
steps:
22+
- name: Check if all jubs succeeded
23+
uses: re-actors/alls-green@release/v1
24+
with:
25+
jobs: ${{ toJSON(needs) }}
26+
27+
test-linux:
28+
name: Test Linux
29+
runs-on: ubuntu-latest
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
rust:
34+
- stable
35+
- beta
36+
- nightly
37+
mb_const_generics:
38+
- ""
39+
- "--features const-generics"
40+
target:
41+
- x86_64
42+
- i686
43+
- sparc64
44+
include:
45+
- mb_const_generics: ""
46+
rust: 1.37.0
47+
target: x86_64
48+
steps:
49+
- uses: actions/checkout@v3
50+
- if: matrix.rust == '1.37.0'
51+
# Rust 1.37 doesn't like modern lock files :(
52+
run: rm Cargo.lock
53+
- uses: dtolnay/rust-toolchain@master
54+
with:
55+
toolchain: ${{ matrix.rust }}
56+
- uses: actions-rs/cargo@v1
57+
with:
58+
use-cross: ${{ matrix.target != 'x86_64' }}
59+
command: test
60+
args: --verbose --features "strict" ${{ matrix.mb_const_generics }} --target ${{ matrix.target }}-unknown-linux-gnu
61+
- uses: actions-rs/cargo@v1
62+
with:
63+
use-cross: ${{ matrix.target != 'x86_64' }}
64+
command: doc
65+
args: --features "strict" ${{ matrix.mb_const_generics }} --target ${{ matrix.target }}-unknown-linux-gnu
66+
67+
test-non-linux:
68+
name: Test non-Linux
69+
runs-on: ${{ matrix.os }}
70+
strategy:
71+
matrix:
72+
os:
73+
- macos-latest
74+
- windows-latest
75+
rust:
76+
- stable
77+
mb_const_generics:
78+
- ""
79+
- "--features const-generics"
80+
steps:
81+
- uses: actions/checkout@v3
82+
- uses: dtolnay/rust-toolchain@master
83+
with:
84+
toolchain: ${{ matrix.rust }}
85+
- uses: extractions/setup-just@v2
86+
- run: just test ${{ matrix.mb_const_generics }}
87+
88+
lint:
89+
name: Lint
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v3
93+
- uses: dtolnay/rust-toolchain@nightly
94+
with:
95+
components: rustfmt, clippy
96+
- uses: extractions/setup-just@v2
97+
- run: just lint
98+
99+
test-generated:
100+
name: Test Generated
101+
runs-on: ubuntu-latest
102+
steps:
103+
- uses: actions/checkout@v3
104+
- uses: dtolnay/rust-toolchain@stable
105+
- uses: extractions/setup-just@v2
106+
- run: just gen
107+
- run: git diff --exit-code
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*'
5+
6+
name: Publish
7+
8+
jobs:
9+
release:
10+
name: GitHub Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: marvinpinto/action-automatic-releases@latest
15+
with:
16+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
17+
prerelease: false
18+
19+
publish:
20+
name: Crates.io Publish
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: dtolnay/rust-toolchain@stable
25+
- uses: katyo/publish-crates@v1
26+
with:
27+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
.direnv/
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Changelog
2+
3+
This project follows semantic versioning.
4+
5+
The MSRV (Minimum Supported Rust Version) is 1.37.0, and typenum is tested
6+
against this Rust version.
7+
8+
### Unreleased
9+
10+
### 1.18.0 (2025-02-17)
11+
- [changed] Remove build scripts; instead check-in the built code (PR #219)
12+
- [added] Constants for 3600 (PR #220)
13+
- [added] Elixir-style syntax for `tarr!` macro (PR #214)
14+
- [added] `FoldAdd` and `FoldMul` to get the sum/product of an array (PR #209)
15+
16+
### 1.17.0 (2023-09-15)
17+
- [removed] Remove `force_unix_path_separator` feature, make it the default
18+
- [added] docs.rs metadata and cfg options
19+
- [added] Playground metadata
20+
21+
### 1.16.0 (2022-12-05)
22+
- [added] `const INT` field to the `ToInt` trait.
23+
- [added] `const-generics` field with `U<N>` mapping where `N` is a const generic.
24+
25+
### 1.15.0 (2021-12-25)
26+
- [fixed] Cross-compilation issue due to doing math in build script. (PR #177)
27+
- [added] New feature `scale_info` for using inside
28+
[Substrate](https://github.com/paritytech/substrate.git)-based runtimes (PR
29+
#175)
30+
31+
### 1.14.0 (2021-09-01)
32+
- [changed] Sealed all marker traits. Documentation already stated that these
33+
should not be implemented outside the crate, so this is not considered a
34+
breaking change.
35+
36+
### 1.13.0 (2021-03-12)
37+
- [changed] MSRV from 1.22.0 to 1.37.0.
38+
- [fixed] `op` macro with 2018 edition import.
39+
- [changed] Allowed calling `assert_type_eq` and `assert_type` at top level.
40+
- [added] Marker trait `Zero` for `Z0`, `U0`, and `B0`.
41+
- [added] Implementation of `Pow` trait for f32 and f64 with negative exponent.
42+
- [added] Trait `ToInt`.
43+
44+
### 1.12.0 (2020-04-13)
45+
- [added] Feature `force_unix_path_separator` to support building without Cargo.
46+
- [added] Greatest common divisor operator `Gcd` with alias `Gcf`.
47+
- [added] `gcd` to the `op!` macro.
48+
- [changed] Added `Copy` bound to `Rhs` of `Mul<Rhs>` impl for `<TArr<V, A>`.
49+
- [changed] Added `Copy` bound to `Rhs` of `Div<Rhs>` impl for `<TArr<V, A>`.
50+
- [changed] Added `Copy` bound to `Rhs` of `PartialDiv<Rhs>` impl for `<TArr<V, A>`.
51+
- [changed] Added `Copy` bound to `Rhs` of `Rem<Rhs>` impl for `<TArr<V, A>`.
52+
- [fixed] Make all functions #[inline].
53+
54+
### 1.11.2 (2019-08-26)
55+
- [fixed] Cross compilation from Linux to Windows.
56+
57+
### 1.11.1 (2019-08-25)
58+
- [fixed] Builds on earlier Rust builds again and added Rust 1.22.0 to Travis to
59+
prevent future breakage.
60+
61+
### 1.11.0 (2019-08-25)
62+
- [added] Integer `log2` to the `op!` macro.
63+
- [added] Integer binary logarithm operator `Logarithm2` with alias `Log2`.
64+
- [changed] Removed `feature(i128_type)` when running with the `i128`
65+
feature. Kept the feature flag. for typenum to maintain compatibility with
66+
old Rust versions.
67+
- [added] Integer `sqrt` to the `op!` macro.
68+
- [added] Integer square root operator `SquareRoot` with alias `Sqrt`.
69+
- [fixed] Bug with attempting to create U1024 type alias twice.
70+
71+
### 1.10.0 (2018-03-11)
72+
- [added] The `PowerOfTwo` marker trait.
73+
- [added] Associated constants for `Bit`, `Unsigned`, and `Integer`.
74+
75+
### 1.9.0 (2017-05-14)
76+
- [added] The `Abs` type operator and corresponding `AbsVal` alias.
77+
- [added] The feature `i128` that enables creating 128-bit integers from
78+
typenums.
79+
- [added] The `assert_type!` and `assert_type_eq!` macros.
80+
- [added] Operators to the `op!` macro, including those performed by `cmp!`.
81+
- [fixed] Bug in `op!` macro involving functions and convoluted expressions.
82+
- [deprecated] The `cmp!` macro.
83+
84+
### 1.8.0 (2017-04-12)
85+
- [added] The `op!` macro for conveniently performing type-level operations.
86+
- [added] The `cmp!` macro for conveniently performing type-level comparisons.
87+
- [added] Some comparison type-operators that are used by the `cmp!` macro.
88+
89+
### 1.7.0 (2017-03-24)
90+
- [added] Type operators `Min` and `Max` with accompanying aliases `Minimum` and
91+
`Maximum`
92+
93+
### 1.6.0 (2017-02-24)
94+
- [fixed] Bug in `Array` division.
95+
- [fixed] Bug where `Rem` would sometimes exit early with the wrong answer.
96+
- [added] `PartialDiv` operator that performs division as a partial function --
97+
it's defined only when there is no remainder.
98+
99+
### 1.5.2 (2017-02-04)
100+
- [fixed] Bug between `Div` implementation and type system.
101+
102+
### 1.5.1 (2016-11-08)
103+
- [fixed] Expanded implementation of `Pow` for primitives.
104+
105+
### 1.5.0 (2016-11-03)
106+
- [added] Functions to the `Pow` and `Len` traits. This is *technically* a
107+
breaking change, but it would only break someone's code if they have a custom
108+
impl for `Pow`. I would be very surprised if that is anyone other than me.
109+
110+
### 1.4.0 (2016-10-29)
111+
- [added] Type-level arrays of type-level integers. (PR #66)
112+
- [added] The types in this crate are now instantiable. (Issue #67, PR #68)
113+
114+
### 1.3.1 (2016-03-31)
115+
- [fixed] Bug with recent nightlies.
116+
117+
### 1.3.0 (2016-02-07)
118+
- [changed] Removed dependency on libstd. (Issue #53, PR #55)
119+
- [changed] Reorganized module structure. (PR #57)
120+
121+
### 1.2.0 (2016-01-03)
122+
- [added] This change log!
123+
- [added] Convenience type aliases for operators. (Issue #48, PR #50)
124+
- [added] Types in this crate now derive all possible traits. (Issue #42, PR
125+
#51)

0 commit comments

Comments
 (0)