Skip to content

Commit c9038e5

Browse files
committed
Turn off feature(const_fn_trait_bound) on docs.rs
This should fix the build errors there
1 parent 9feffad commit c9038e5

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ never = []
2121
# Support the 'builtin' alternative to stdlib types
2222
builtins = []
2323

24-
2524
[workspace]
2625
members = ["lib/*"]
26+
27+
# Workaround for outdated nightly
28+
[package.metadata.docs.rs]
29+
rustc-args = ["--cfg", "docs_rs"]

src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@
1313
#![feature(
1414
const_fn, // We rely on const eval :(
1515
const_panic, const_option, // We use Option::unwrap
16-
const_fn_trait_bound, // This is required on recent nightly
1716
const_fn_fn_ptr_basics, // We use PhantomData<fn() -> T>
1817
// Used for field_offset macro
1918
const_raw_ptr_deref,
2019
const_raw_ptr_to_usize_cast,
2120
)]
21+
/*
22+
* This is required on recent nightly
23+
*
24+
* However it breaks on the version that docs.rs is using (as of this writing).
25+
* Therefore, we have to turn it off there.
26+
*/
27+
#![cfg_attr(not(docs_rs), feature(const_fn_trait_bound))]
2228
#![cfg_attr(feature = "never", feature(never_type))]
2329

2430
mod macros;
@@ -71,4 +77,4 @@ pub unsafe trait FieldReflect: StaticReflect {
7177
/// Static information on this structure's fields,
7278
/// where each field's information is given by name
7379
const NAMED_FIELD_INFO: Self::NamedFieldInfo;
74-
}
80+
}

0 commit comments

Comments
 (0)