-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build script to check for nightly (#112)
The rustdoc_missing_doc_code_examples lint has been sending warnings and causing CI issues due to being an unstable feature. This change introduces a small build script that detects whether the current toolchain is nightly and, if so, sets the config option "nightly_features". This config option then sets the feature gate for missing_doc_code_examples and turns on 'warn'. It expands the existing code for parsing minor version to parse the rest of the rust --version. This change also introduces a toolchain test that uses rust_version to double-check that the config option was enabled IFF the nightly toolchain is being used.
- Loading branch information
Showing
4 changed files
with
51 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#[rustversion::attr(not(nightly), ignore)] | ||
//#[cfg_attr(miri, ignore)] | ||
#[test] | ||
fn nightlytest() { | ||
if !cfg!(nightly_features) { | ||
panic!("nightly feature isn't set when the toolchain is nightly"); | ||
} | ||
} | ||
|
||
#[rustversion::attr(nightly, ignore)] | ||
//#[cfg_attr(miri, ignore)] | ||
#[test] | ||
fn stabletest() { | ||
if cfg!(nightly_features) { | ||
panic!("nightly feature is set when the toolchain isn't nightly"); | ||
} | ||
} |