diff --git a/Cargo.lock b/Cargo.lock index b02c7582..24d181f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1882,7 +1882,7 @@ dependencies = [ "http", "num-bigint-dig", "oid", - "picky-asn1 0.3.2", + "picky-asn1 0.3.3", "picky-asn1-der 0.2.5", "picky-asn1-x509 0.6.1", "pretty_assertions", @@ -1909,7 +1909,7 @@ dependencies = [ [[package]] name = "picky-asn1" -version = "0.3.2" +version = "0.3.3" dependencies = [ "chrono", "oid", @@ -1936,7 +1936,7 @@ dependencies = [ "lazy_static", "num-bigint-dig", "oid", - "picky-asn1 0.3.2", + "picky-asn1 0.3.3", "pretty_assertions", "serde", "serde_bytes", @@ -1964,7 +1964,7 @@ dependencies = [ "hex", "num-bigint-dig", "oid", - "picky-asn1 0.3.2", + "picky-asn1 0.3.3", "picky-asn1-der 0.2.5", "pretty_assertions", "serde", @@ -1987,7 +1987,7 @@ dependencies = [ "multibase", "multihash", "picky 6.3.0", - "picky-asn1 0.3.2", + "picky-asn1 0.3.3", "rand 0.8.3", "reqwest 0.11.3", "saphir", diff --git a/ci/azure-pipelines.yaml b/ci/azure-pipelines.yaml index 6a6cb164..9f256bbe 100644 --- a/ci/azure-pipelines.yaml +++ b/ci/azure-pipelines.yaml @@ -88,3 +88,25 @@ jobs: pathToPublish: $(Build.ArtifactStagingDirectory) artifactName: picky + - job: msrv + # Minimum supported Rust version check for published crates. + # If this break, bump crate version minor number. + # See https://github.com/Devolutions/picky-rs/issues/89 + + pool: + vmImage: ubuntu-18.04 + steps: + - script: | + set -e + curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain 1.43 + rustup toolchain install 1.49 + displayName: "Install rust 1.43 and 1.49" + - script: cargo +1.43 check -p picky-asn1 + displayName: cargo check picky-asn1 + - script: cargo +1.43 check -p picky-asn1-der + displayName: cargo check picky-asn1-der + - script: cargo +1.43 check -p picky-asn1-x509 + displayName: cargo check picky-asn1-x509 + - script: cargo +1.49 check -p picky + displayName: cargo check picky + diff --git a/picky-asn1-der/README.md b/picky-asn1-der/README.md index 6126ab1f..f65c54d2 100644 --- a/picky-asn1-der/README.md +++ b/picky-asn1-der/README.md @@ -2,6 +2,9 @@ [![docs.rs](https://docs.rs/picky-asn1-der/badge.svg)](https://docs.rs/picky-asn1-der) ![Crates.io](https://img.shields.io/crates/l/picky-asn1-der) +Compatible with rustc 1.43. +Minimal rustc version bumps happen [only with minor number bumps in this project](https://github.com/Devolutions/picky-rs/issues/89#issuecomment-868303478). + # picky-asn1-der Portions of project [serde_asn1_der](https://github.com/KizzyCode/serde_asn1_der) are held by diff --git a/picky-asn1-x509/README.md b/picky-asn1-x509/README.md index c163eaba..7d6a66cf 100644 --- a/picky-asn1-x509/README.md +++ b/picky-asn1-x509/README.md @@ -2,6 +2,9 @@ [![docs.rs](https://docs.rs/picky-asn1-x509/badge.svg)](https://docs.rs/picky-asn1-x509) ![Crates.io](https://img.shields.io/crates/l/picky-asn1-x509) +Compatible with rustc 1.43. +Minimal rustc version bumps happen [only with minor number bumps in this project](https://github.com/Devolutions/picky-rs/issues/89#issuecomment-868303478). + # picky-asn1-x509 Provide implementation for types defined in [X.509 RFC](https://tools.ietf.org/html/rfc5280) and related RFC ([PKCS#8](https://tools.ietf.org/html/rfc5208), [PKCS#10](https://tools.ietf.org/html/rfc2986)). @@ -11,3 +14,4 @@ This is a low-level library providing only raw types for serialization and deser These types are implementing `serde`'s `Serialize` and `Deserialize` and are to be used with [picky-asn1-der](https://crates.io/crates/picky-asn1-der). If you're looking for a higher level API, you may be interested by the [picky crate](https://crates.io/crates/picky) which uses this library internally and provides a nicer API. + diff --git a/picky-asn1-x509/src/oids.rs b/picky-asn1-x509/src/oids.rs index 4a51323a..6123a6ce 100644 --- a/picky-asn1-x509/src/oids.rs +++ b/picky-asn1-x509/src/oids.rs @@ -13,9 +13,8 @@ /// I mean, I'm literally creating infinity out of emptiness. /// If you don't care about your mental sanity, you can read the /// [nomicon on unchecked uninitialized memory](https://doc.rust-lang.org/nomicon/unchecked-uninit.html). -#[allow(invalid_value)] unsafe fn unreachable() -> ! { - core::mem::MaybeUninit::uninit().assume_init() + std::hint::unreachable_unchecked() } macro_rules! define_oid { diff --git a/picky-asn1/CHANGELOG.md b/picky-asn1/CHANGELOG.md index 2062c883..5f30678f 100644 --- a/picky-asn1/CHANGELOG.md +++ b/picky-asn1/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [0.3.3] 2021-07-02 + +### Fixed + +- Support for rustc 1.43 (accidently bumped in 0.3.2). See [#89](https://github.com/Devolutions/picky-rs/issues/89). + ## [0.3.2] 2021-05-27 ### Added diff --git a/picky-asn1/Cargo.toml b/picky-asn1/Cargo.toml index 8245b120..2bf554d8 100644 --- a/picky-asn1/Cargo.toml +++ b/picky-asn1/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "picky-asn1" -version = "0.3.2" +version = "0.3.3" edition = "2018" authors = [ "BenoƮt CORTIER ", diff --git a/picky-asn1/README.md b/picky-asn1/README.md index 914e41e7..c8c1beb0 100644 --- a/picky-asn1/README.md +++ b/picky-asn1/README.md @@ -2,6 +2,9 @@ [![docs.rs](https://docs.rs/picky-asn1/badge.svg)](https://docs.rs/picky-asn1) ![Crates.io](https://img.shields.io/crates/l/picky-asn1) +Compatible with rustc 1.43. +Minimal rustc version bumps happen [only with minor number bumps in this project](https://github.com/Devolutions/picky-rs/issues/89#issuecomment-868303478). + # picky-asn1 Defines wrappers for ASN.1 types: diff --git a/picky-asn1/src/restricted_string.rs b/picky-asn1/src/restricted_string.rs index bc4455f8..d7a7955e 100644 --- a/picky-asn1/src/restricted_string.rs +++ b/picky-asn1/src/restricted_string.rs @@ -265,7 +265,7 @@ impl CharSet for BMPCharSet { .into_iter() .map(|elem| u16::from_be_bytes([elem[1], elem[0]])); - char::decode_utf16(u16_it).all(|c| matches!(c, Ok(_))) + core::char::decode_utf16(u16_it).all(|c| matches!(c, Ok(_))) } } diff --git a/picky/README.md b/picky/README.md index 9d80e876..9e3f7aaf 100644 --- a/picky/README.md +++ b/picky/README.md @@ -2,6 +2,9 @@ [![docs.rs](https://docs.rs/picky/badge.svg)](https://docs.rs/picky) ![Crates.io](https://img.shields.io/crates/l/picky) +Compatible with rustc 1.49. +Minimal rustc version bumps happen [only with minor number bumps in this project](https://github.com/Devolutions/picky-rs/issues/89#issuecomment-868303478). + # picky Portable X.509, PKI, JOSE and HTTP signature implementation. diff --git a/setup-git-hooks.sh b/setup-git-hooks.sh index aa335d17..cc9bf1db 100755 --- a/setup-git-hooks.sh +++ b/setup-git-hooks.sh @@ -8,11 +8,32 @@ if test -f "$PRE_COMMIT_HOOK"; then fi echo "#!/bin/sh +git stash -q --keep-index + +ret=0 + cargo +stable fmt --all -- --check 2> /dev/null + if ! [ \$? -eq 0 ] ; then + ret=1 printf \"\n\$(tput setaf 3)Bad formatting, please run 'cargo +stable fmt' and stage modifications\n\n\" - exit 1 -fi" > "$PRE_COMMIT_HOOK" +fi + +cargo clippy -- -D warnings + +if ! [ \$? -eq 0 ] ; then + ret=1 + printf \"\n\$(tput setaf 3)Fix clippy lints and stage modifications\n\n\" +fi + +if ! [ \$ret -eq 0 ] ; then + printf \"\$(tput setaf 1)Git pre-commit hook failed.\$(tput sgr0)\n\" + printf \"Alternatively, \\\`--no-verify\\\` or \\\`-n\\\` option may be used to bypass the pre-commit hook.\n\" +fi + +git stash pop -q + +exit \$ret" > "$PRE_COMMIT_HOOK" chmod +x "$PRE_COMMIT_HOOK" echo "$(tput setaf 2)$PRE_COMMIT_HOOK created"