Skip to content

Commit e53a6c0

Browse files
authored
Merge pull request #145 from cuviper/explicit-std
Add a feature to explicitly enable "std"
2 parents 132814c + 4de0dcf commit e53a6c0

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ matrix:
1010
- rust: stable
1111
env:
1212
- FEATURES='rayon'
13+
- rust: stable
14+
env:
15+
- FEATURES='std'
1316
- rust: beta
1417
- rust: nightly
1518
env:

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "indexmap"
33
edition = "2018"
4-
version = "1.5.1"
4+
version = "1.5.2"
55
authors = [
66
"bluss",
77
"Josh Stone <cuviper@gmail.com>"
@@ -53,6 +53,9 @@ fxhash = "0.2.1"
5353
# Serialization with serde 1.0
5454
serde-1 = ["serde"]
5555

56+
# Force the use of `std`, bypassing target detection.
57+
std = []
58+
5659
# for testing only, of course
5760
test_low_transition_point = []
5861
test_debug = []

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ which is roughly:
6666
Recent Changes
6767
==============
6868

69+
- 1.5.2
70+
71+
- The new "std" feature will force the use of ``std`` for users that explicitly
72+
want the default ``S = RandomState``, bypassing the autodetection added in 1.3.0,
73+
by @cuviper in PR 145_.
74+
75+
.. _145: https://github.com/bluss/indexmap/pull/145
76+
6977
- 1.5.1
7078

7179
- Values can now be indexed by their ``usize`` position by @cuviper in PR 132_.

build.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
fn main() {
2-
let ac = autocfg::new();
3-
ac.emit_sysroot_crate("std");
2+
// If "std" is explicitly requested, don't bother probing the target for it.
3+
match std::env::var_os("CARGO_FEATURE_STD") {
4+
Some(_) => autocfg::emit("has_std"),
5+
None => autocfg::new().emit_sysroot_crate("std"),
6+
}
47
autocfg::rerun_path("build.rs");
58
}

0 commit comments

Comments
 (0)