Skip to content

Commit 21d5794

Browse files
committed
Disable rustc-serialize derives for future compilers
The built-in derives are being [removed], but crater showed problems with crates depending on `num v0.1`, where this feature is enabled by default. With this PR, we detect the missing built-ins and disable the derives, adding a build-script warning about it. Cargo won't show such warnings by default from non-path dependencies, unless the build fails. For `num` itself, this mostly just amounts to a dependency bump. [removed]: rust-lang/rust#134272
1 parent 5c7cb7d commit 21d5794

File tree

5 files changed

+20
-21
lines changed

5 files changed

+20
-21
lines changed

.travis.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ rust:
55
- nightly
66
matrix:
77
include:
8-
- rust: 1.8.0
8+
- rust: 1.19.0
99
before_script:
10-
# rand 0.3.22 started depending on rand 0.4, which requires rustc 1.15
11-
# manually hacking the lockfile due to the limitations of cargo#2773
1210
- cargo generate-lockfile
13-
- sed -i -e 's/"rand 0.[34].[0-9]\+/"rand 0.3.20/' Cargo.lock
14-
- sed -i -e '/^name = "rand"/,/^$/s/version = "0.3.[0-9]\+"/version = "0.3.20"/' Cargo.lock
11+
- cargo update -p num-iter --precise 0.1.43
12+
- cargo update -p num-integer --precise 0.1.45
13+
- cargo update -p num-traits --precise 0.2.15
14+
- cargo update -p libc --precise 0.2.163
1515
sudo: false
1616
script:
1717
- cargo build --verbose

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ categories = [ "algorithms", "data-structures", "science" ]
88
license = "MIT/Apache-2.0"
99
repository = "https://github.com/rust-num/num"
1010
name = "num"
11-
version = "0.1.42"
11+
version = "0.1.43"
1212
readme = "README.md"
1313

1414
[badges]
@@ -18,11 +18,11 @@ travis-ci = { repository = "rust-num/num" }
1818

1919
[dependencies.num-bigint]
2020
optional = true
21-
version = "0.1.42"
21+
version = "0.1.45"
2222

2323
[dependencies.num-complex]
2424
optional = true
25-
version = "0.1.42"
25+
version = "0.1.44"
2626

2727
[dependencies.num-integer]
2828
version = "0.1.36"
@@ -32,7 +32,7 @@ version = "0.1.35"
3232

3333
[dependencies.num-rational]
3434
optional = true
35-
version = "0.1.42"
35+
version = "0.1.43"
3636

3737
[dependencies.num-traits]
3838
version = "0.2.0"

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![crate](https://img.shields.io/crates/v/num.svg)](https://crates.io/crates/num)
44
[![documentation](https://docs.rs/num/badge.svg)](https://docs.rs/num)
5-
![minimum rustc 1.8](https://img.shields.io/badge/rustc-1.8+-red.svg)
5+
![minimum rustc 1.19](https://img.shields.io/badge/rustc-1.19+-red.svg)
66
[![Travis status](https://travis-ci.org/rust-num/num.svg?branch=master)](https://travis-ci.org/rust-num/num)
77

88
A collection of numeric types and traits for Rust.
@@ -57,5 +57,4 @@ Release notes are available in [RELEASES.md](RELEASES.md).
5757

5858
## Compatibility
5959

60-
Most of the `num` crates are tested for rustc 1.8 and greater.
61-
The exception is `num-derive` which requires at least rustc 1.15.
60+
The `num` crate is tested for rustc 1.19 and greater.

ci/rustup.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#!/bin/sh
22
# Use rustup to locally run the same suite of tests as .travis.yml.
3-
# (You should first install/update 1.8.0, stable, beta, and nightly.)
3+
# (You should first install/update 1.19.0, stable, beta, and nightly.)
44

55
set -ex
66

77
export TRAVIS_RUST_VERSION
8-
for TRAVIS_RUST_VERSION in 1.8.0 stable beta nightly; do
8+
for TRAVIS_RUST_VERSION in 1.19.0 stable beta nightly; do
99
run="rustup run $TRAVIS_RUST_VERSION"
10-
if [ "$TRAVIS_RUST_VERSION" = 1.8.0 ]; then
11-
# rand 0.3.22 started depending on rand 0.4, which requires rustc 1.15
12-
# manually hacking the lockfile due to the limitations of cargo#2773
13-
$run cargo generate-lockfile
14-
$run sed -i -e 's/"rand 0.[34].[0-9]\+/"rand 0.3.20/' Cargo.lock
15-
$run sed -i -e '/^name = "rand"/,/^$/s/version = "0.3.[0-9]\+"/version = "0.3.20"/' Cargo.lock
10+
$run cargo generate-lockfile
11+
if [ "$TRAVIS_RUST_VERSION" = 1.19.0 ]; then
12+
$run cargo update -p num-iter --precise 0.1.43
13+
$run cargo update -p num-integer --precise 0.1.45
14+
$run cargo update -p num-traits --precise 0.2.15
15+
$run cargo update -p libc --precise 0.2.163
1616
fi
1717
$run cargo build --verbose
1818
$run $PWD/ci/test_full.sh

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
//!
5656
//! ## Compatibility
5757
//!
58-
//! The `num` crate is tested for rustc 1.8 and greater.
58+
//! The `num` crate is tested for rustc 1.19 and greater.
5959
6060
#![doc(html_root_url = "https://docs.rs/num/0.1")]
6161

0 commit comments

Comments
 (0)