Skip to content

Commit

Permalink
doc: bump minimum Rust version to 1.20.0
Browse files Browse the repository at this point in the history
This also clarifies our policy on increasing the minimum Rust version
required. In particular, we reserve the right to increase the minimum
Rust version in minor version releases of regexes, but never in patch
releases. We will default to a reasonably conservative interpretation
of this policy, and not bump the minimum required Rust version lightly.

If this policy turns out to be too aggressive, then we may alter it in
the future to state that the minimum Rust version is fixed for all of
regex 1.y.z, and can only be bumped on major regex version releases.

See: rust-lang#457
  • Loading branch information
BurntSushi committed Apr 28, 2018
1 parent 4e3a107 commit e7e12dd
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,7 @@ dist: trusty
sudo: false
language: rust
rust:
- 1.12.0
- 1.20.0
- stable
- beta
- nightly
Expand Down
18 changes: 17 additions & 1 deletion README.md
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
9 changes: 0 additions & 9 deletions ci/script.sh
Expand Up @@ -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
Expand Down
18 changes: 5 additions & 13 deletions src/vector/avx2.rs
Expand Up @@ -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 {
Expand Down
36 changes: 14 additions & 22 deletions src/vector/ssse3.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit e7e12dd

Please sign in to comment.