Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a feature to explicitly enable "std" #145

Merged
merged 2 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ matrix:
- rust: stable
env:
- FEATURES='rayon'
- rust: stable
env:
- FEATURES='std'
- rust: beta
- rust: nightly
env:
Expand Down
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "indexmap"
edition = "2018"
version = "1.5.1"
version = "1.5.2"
authors = [
"bluss",
"Josh Stone <cuviper@gmail.com>"
Expand Down Expand Up @@ -53,6 +53,9 @@ fxhash = "0.2.1"
# Serialization with serde 1.0
serde-1 = ["serde"]

# Force the use of `std`, bypassing target detection.
std = []

# for testing only, of course
test_low_transition_point = []
test_debug = []
Expand Down
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ which is roughly:
Recent Changes
==============

- 1.5.2

- The new "std" feature will force the use of ``std`` for users that explicitly
want the default ``S = RandomState``, bypassing the autodetection added in 1.3.0,
by @cuviper in PR 145_.

.. _145: https://github.com/bluss/indexmap/pull/145

- 1.5.1

- Values can now be indexed by their ``usize`` position by @cuviper in PR 132_.
Expand Down
7 changes: 5 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
fn main() {
let ac = autocfg::new();
ac.emit_sysroot_crate("std");
// If "std" is explicitly requested, don't bother probing the target for it.
match std::env::var_os("CARGO_FEATURE_STD") {
Some(_) => autocfg::emit("has_std"),
None => autocfg::new().emit_sysroot_crate("std"),
}
autocfg::rerun_path("build.rs");
}