Skip to content

Commit

Permalink
msrv: bump to 1.46.0 and specify policy
Browse files Browse the repository at this point in the history
The next release will be a breaking change release anyway.

We update a few other things as well. The examples in particular.
  • Loading branch information
BurntSushi committed Dec 27, 2020
1 parent 467f272 commit 282f146
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 23,7 @@ jobs:
include:
- build: pinned
os: ubuntu-18.04
rust: 1.34.0
rust: 1.46.0
- build: stable
os: ubuntu-18.04
rust: stable
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 135,7 @@ default and thus no longer available.

### Minimum Rust version policy

This crate's minimum supported `rustc` version is `1.34.0`.
This crate's minimum supported `rustc` version is `1.46.0`.

The current policy is that the minimum Rust version required to use this crate
can be increased in minor version updates. For example, if `crate 1.0` requires
Expand Down
6 changes: 3 additions & 3 deletions examples/btree_set_range.rs
Original file line number Diff line number Diff line change
@@ -1,16 1,16 @@
extern crate quickcheck;

use quickcheck::{quickcheck, TestResult};
use std::collections::BTreeSet;
use std::ops::Bound::{self, *};

use quickcheck::{quickcheck, TestResult};

/// Covers every `std::ops::Range*` plus variants with exclusive start.
type RangeAny<T> = (Bound<T>, Bound<T>);

/// Mimic `RangeBounds::contains`, stabilized in Rust 1.35.
trait RangeBounds<T> {
fn contains(&self, _: &T) -> bool;
}

impl<T: PartialOrd> RangeBounds<T> for RangeAny<T> {
fn contains(&self, item: &T) -> bool {
(match &self.0 {
Expand Down
2 changes: 0 additions & 2 deletions examples/out_of_bounds.rs
Original file line number Diff line number Diff line change
@@ -1,5 1,3 @@
extern crate quickcheck;

use quickcheck::{quickcheck, TestResult};

fn main() {
Expand Down
2 changes: 0 additions & 2 deletions examples/reverse.rs
Original file line number Diff line number Diff line change
@@ -1,5 1,3 @@
extern crate quickcheck;

use quickcheck::quickcheck;

fn reverse<T: Clone>(xs: &[T]) -> Vec<T> {
Expand Down
2 changes: 0 additions & 2 deletions examples/reverse_single.rs
Original file line number Diff line number Diff line change
@@ -1,5 1,3 @@
extern crate quickcheck;

use quickcheck::{quickcheck, TestResult};

fn reverse<T: Clone>(xs: &[T]) -> Vec<T> {
Expand Down
2 changes: 0 additions & 2 deletions examples/sieve.rs
Original file line number Diff line number Diff line change
@@ -1,5 1,3 @@
extern crate quickcheck;

use quickcheck::quickcheck;

fn sieve(n: usize) -> Vec<usize> {
Expand Down
6 changes: 2 additions & 4 deletions examples/sort.rs
Original file line number Diff line number Diff line change
@@ -1,16 1,14 @@
// This is a buggy quick sort implementation, QuickCheck will find the bug for
// you.

extern crate quickcheck;

use quickcheck::quickcheck;

fn smaller_than<T: Clone Ord>(xs: &[T], pivot: &T) -> Vec<T> {
return xs.iter().filter(|&x| *x < *pivot).map(|x| x.clone()).collect();
xs.iter().filter(|&x| *x < *pivot).map(|x| x.clone()).collect()
}

fn larger_than<T: Clone Ord>(xs: &[T], pivot: &T) -> Vec<T> {
return xs.iter().filter(|&x| *x > *pivot).map(|x| x.clone()).collect();
xs.iter().filter(|&x| *x > *pivot).map(|x| x.clone()).collect()
}

fn sortk<T: Clone Ord>(x: &T, xs: &[T]) -> Vec<T> {
Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 6,6 @@
#![cfg_attr(feature = "i128", feature(i128_type, i128))]

#[cfg(feature = "use_logging")]
extern crate env_logger;
#[cfg(feature = "use_logging")]
#[macro_use]
extern crate log;

pub use crate::arbitrary::{empty_shrinker, single_shrinker, Arbitrary, Gen};
pub use crate::tester::{quickcheck, QuickCheck, TestResult, Testable};

Expand Down Expand Up @@ -68,6 62,12 @@ macro_rules! quickcheck {
fn env_logger_init() -> Result<(), log::SetLoggerError> {
env_logger::try_init()
}
#[cfg(feature = "use_logging")]
macro_rules! info {
($($tt:tt)*) => {
log::info!($($tt)*)
};
}

#[cfg(not(feature = "use_logging"))]
fn env_logger_init() {}
Expand Down

0 comments on commit 282f146

Please sign in to comment.