Skip to content

Commit

Permalink
Merge branch 'WaffleLapkin-const_assert_ty_eq'
Browse files Browse the repository at this point in the history
  • Loading branch information
paholg committed Mar 12, 2021
2 parents 92504db + 2955684 commit 87f87e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
rust:
- 1.22.0
- 1.37.0
- stable
- beta
- nightly
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

This project follows semantic versioning.

The MSRV (Minimum Supported Rust Version) is 1.22.0, and typenum is tested against this Rust
version. Much of typenum should work on as low a version as 1.20.0, but that is not guaranteed.
The MSRV (Minimum Supported Rust Version) is 1.37.0, and typenum is tested against this Rust
version.

### Unreleased
- [fixed] `op` macro with 2018 edition

- [changed] Allowed calling `assert_type_eq` and `assert_type` at top level

### 1.12.0 (2020-04-13)
- [added] Feature `force_unix_path_separator` to support building without Cargo.
- [added] Greatest common divisor operator `Gcd` with alias `Gcf`.
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ impl Ord for Equal {
#[macro_export]
macro_rules! assert_type_eq {
($a:ty, $b:ty) => {
let _: <$a as $crate::Same<$b>>::Output;
const _: core::marker::PhantomData<<$a as $crate::Same<$b>>::Output> = core::marker::PhantomData;
};
}

/// Asserts that a type is `True`, aka `B1`.
#[macro_export]
macro_rules! assert_type {
($a:ty) => {
let _: <$a as $crate::Same<True>>::Output;
const _: core::marker::PhantomData<<$a as $crate::Same<True>>::Output> = core::marker::PhantomData;
};
}

0 comments on commit 87f87e8

Please sign in to comment.