Skip to content

Commit 86c6ee2

Browse files
committed
build: drop unstable doc_cfg
With `alloc` stabilized, we want to get rid of any other unstable feature. So replace the `doc_cfg` feature with a simple `doctest = false`. As sad as it is, there currently seems to be no other way to get this working. Meh.. Lets see what the future brings. Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
1 parent 6f9699d commit 86c6ee2

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ keywords = [
2525
license = "Apache-2.0 OR LGPL-2.1-or-later"
2626
readme = "README.md"
2727
repository = "https://github.com/r-util/r-efi-string"
28+
29+
[lib]
30+
# We do not link to an allocator by default, because we allow the crate user to
31+
# select one. This, however, makes `doctest` fall over. Sadly, there is no
32+
# stabilized way to conditionally compile in code for doctests. Therefore, we
33+
# disable them for now. Maybe some day `cfg(doctest)` will be stabilized...
34+
doctest = false

src/lib.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@
88
//!
99
//! * `[str16]`: UCS-2 based strings, which use a `u16` based encoding.
1010
11-
// We currently need some unstable features:
12-
//
13-
// * We use `doc_cfg` to run conditional code in rustdoc compilations. This is, again, related to
14-
// `no_std`, since we want to make sure the rustdoc examples still work correctly.
15-
#![feature(doc_cfg)]
16-
17-
// We do not depend on `libstd`, but pull it in for our unit tests and documentation.
18-
#![cfg_attr(not(any(test, rustdoc)), no_std)]
11+
// We do not depend on `libstd`, but pull it in for our unit tests.
12+
#![cfg_attr(not(test), no_std)]
1913

2014
// We provide converters to/from `alloc::string::String`, so import `liballoc`.
2115
extern crate alloc;

0 commit comments

Comments
 (0)