diff --git a/.travis.yml b/.travis.yml index d63fe13dfa..f6f43acb66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ dist: trusty sudo: false language: rust rust: -- 1.12.0 +- 1.20.0 - stable - beta - nightly diff --git a/README.md b/README.md index c61ba4a644..8828183014 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ by [RE2](https://github.com/google/re2). [![Build status](https://ci.appveyor.com/api/projects/status/github/rust-lang/regex?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/regex) [![Coverage Status](https://coveralls.io/repos/github/rust-lang/regex/badge.svg?branch=master)](https://coveralls.io/github/rust-lang/regex?branch=master) [![](http://meritbadge.herokuapp.com/regex)](https://crates.io/crates/regex) +[![Rust](https://img.shields.io/badge/rust-1.20%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/regex) ### Documentation @@ -210,7 +211,22 @@ recommended for general use. [Documentation `regex-syntax`.](https://docs.rs/regex-syntax) -# License + +### Minimum Rust version policy + +This crate's minimum supported `rustc` version is `1.20.0`. + +The current **tentative** policy is that the minimum Rust version required to +use this crate can be increased in minor version updates. For example, if +regex 1.0.0 requires Rust 1.20.0, then regex 1.0.z for all values of `z` will +also require Rust 1.20.0 or newer. However, regex 1.y for `y > 0` may require +a newer minimum version of Rust. + +In general, this crate will be conservative with respect to the minimum +supported version of Rust. + + +### License This project is licensed under either of diff --git a/ci/script.sh b/ci/script.sh index baaca969e6..64fafc0d37 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -8,15 +8,6 @@ set -ex cargo build --verbose cargo doc --verbose -# If we're testing on an older version of Rust, then only check that we -# can build the crate. This is because the dev dependencies might be updated -# more frequently, and therefore might require a newer version of Rust. -# -# This isn't ideal. It's a compromise. -if [ "$TRAVIS_RUST_VERSION" = "1.12.0" ]; then - exit -fi - # Run tests. If we have nightly, then enable our nightly features. if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then cargo test --verbose --features unstable diff --git a/src/vector/avx2.rs b/src/vector/avx2.rs index 28f89d6a76..db0532c3fe 100644 --- a/src/vector/avx2.rs +++ b/src/vector/avx2.rs @@ -54,21 +54,13 @@ impl AVX2VectorBuilder { } } -// We define our union with a macro so that our code continues to compile on -// Rust 1.12. -macro_rules! defunion { - () => { - #[derive(Clone, Copy)] - #[allow(non_camel_case_types)] - pub union u8x32 { - vector: __m256i, - bytes: [u8; 32], - } - } +#[derive(Clone, Copy)] +#[allow(non_camel_case_types)] +pub union u8x32 { + vector: __m256i, + bytes: [u8; 32], } -defunion!(); - impl u8x32 { #[inline] unsafe fn splat(n: u8) -> u8x32 { diff --git a/src/vector/ssse3.rs b/src/vector/ssse3.rs index 4107381d15..0485657f01 100644 --- a/src/vector/ssse3.rs +++ b/src/vector/ssse3.rs @@ -66,30 +66,22 @@ impl SSSE3VectorBuilder { } } -// We define our union with a macro so that our code continues to compile on -// Rust 1.12. -macro_rules! defunion { - () => { - /// A u8x16 is a 128-bit vector with 16 single-byte lanes. - /// - /// It provides a safe API that uses only SSE2 or SSSE3 instructions. - /// The only way for callers to construct a value of this type is - /// through the SSSE3VectorBuilder type, and the only way to get a - /// SSSE3VectorBuilder is if the `ssse3` target feature is enabled. - /// - /// Note that generally speaking, all uses of this type should get - /// inlined, otherwise you probably have a performance bug. - #[derive(Clone, Copy)] - #[allow(non_camel_case_types)] - pub union u8x16 { - vector: __m128i, - bytes: [u8; 16], - } - } +/// A u8x16 is a 128-bit vector with 16 single-byte lanes. +/// +/// It provides a safe API that uses only SSE2 or SSSE3 instructions. +/// The only way for callers to construct a value of this type is +/// through the SSSE3VectorBuilder type, and the only way to get a +/// SSSE3VectorBuilder is if the `ssse3` target feature is enabled. +/// +/// Note that generally speaking, all uses of this type should get +/// inlined, otherwise you probably have a performance bug. +#[derive(Clone, Copy)] +#[allow(non_camel_case_types)] +pub union u8x16 { + vector: __m128i, + bytes: [u8; 16], } -defunion!(); - impl u8x16 { #[inline] unsafe fn splat(n: u8) -> u8x16 {