Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 909fcfc

Browse files
committedApr 15, 2024
Stabilize checking of cfgs at compile-time: --check-cfg option
1 parent 99d0186 commit 909fcfc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+60
-95
lines changed
 

‎compiler/rustc_session/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
13731373
opt::flag_s("h", "help", "Display this message"),
13741374
opt::multi_s("", "cfg", "Configure the compilation environment.
13751375
SPEC supports the syntax `NAME[=\"VALUE\"]`.", "SPEC"),
1376-
opt::multi("", "check-cfg", "Provide list of valid cfg options for checking", "SPEC"),
1376+
opt::multi_s("", "check-cfg", "Provide list of expected cfgs for checking", "SPEC"),
13771377
opt::multi_s(
13781378
"L",
13791379
"",

‎src/librustdoc/doctest.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,8 @@ pub(crate) fn generate_args_file(file_path: &Path, options: &RustdocOptions) ->
6060
for cfg in &options.cfgs {
6161
content.push(format!("--cfg={cfg}"));
6262
}
63-
if !options.check_cfgs.is_empty() {
64-
content.push("-Zunstable-options".to_string());
65-
for check_cfg in &options.check_cfgs {
66-
content.push(format!("--check-cfg={check_cfg}"));
67-
}
63+
for check_cfg in &options.check_cfgs {
64+
content.push(format!("--check-cfg={check_cfg}"));
6865
}
6966

7067
for lib_str in &options.lib_strs {

0 commit comments

Comments
 (0)
Please sign in to comment.