diff options
| author | bors <bors@rust-lang.org> | 2023-08-23 16:10:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-08-23 16:10:43 +0000 |
| commit | 8e8231f64eb81094222483a7dca9ef507891eaed (patch) | |
| tree | 2d77826cf8859bdda7c5b9592f72c615a7e83bce /src | |
| parent | 97fff1f2ed01f6f7c0c204530b693c74d88c2105 (diff) | |
| parent | 5cbc00fb7ed54e90623138b8dfe4d62669270965 (diff) | |
Auto merge of #115137 - GuillaumeGomez:rollup-37jqoyg, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - #114696 (Fix a pthread_t handle leak #114610) - #115102 (Improve note for the `invalid_reference_casting` lint) - #115103 (Disable bootstrap rustc version check) - #115106 (ArchiveWrapper: handle LLVM API update) - #115109 (Skip ExpandYamlAnchors when the config is missing) - #115135 (Rustdoc: Add unstable --no-html-source flag) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/config.rs | 3 | ||||
| -rw-r--r-- | src/bootstrap/test.rs | 5 | ||||
| -rw-r--r-- | src/librustdoc/config.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/render/context.rs | 3 | ||||
| -rw-r--r-- | src/librustdoc/lib.rs | 3 |
5 files changed, 16 insertions, 2 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 4821d20a898..762e66ac7cc 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -1276,7 +1276,8 @@ impl Config { } config.initial_rustc = if let Some(rustc) = build.rustc { - config.check_build_rustc_version(&rustc); + // FIXME(#115065): re-enable this check + // config.check_build_rustc_version(&rustc); PathBuf::from(rustc) } else { config.download_beta_toolchain(); diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index db3b7ffbea4..d1018978f78 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1174,6 +1174,11 @@ impl Step for ExpandYamlAnchors { /// appropriate configuration for all our CI providers. This step ensures the tool was called /// by the user before committing CI changes. fn run(self, builder: &Builder<'_>) { + // Note: `.github/` is not included in dist-src tarballs + if !builder.src.join(".github/workflows/ci.yml").exists() { + builder.info("Skipping YAML anchors check: GitHub Actions config not found"); + return; + } builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded"); builder.run_delaying_failure( &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 81fb13f4166..1ce7efdfc20 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -273,6 +273,8 @@ pub(crate) struct RenderOptions { pub(crate) call_locations: AllCallLocations, /// If `true`, Context::init will not emit shared files. pub(crate) no_emit_shared: bool, + /// If `true`, HTML source code pages won't be generated. + pub(crate) html_no_source: bool, } #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -686,6 +688,7 @@ impl Options { let generate_link_to_definition = matches.opt_present("generate-link-to-definition"); let extern_html_root_takes_precedence = matches.opt_present("extern-html-root-takes-precedence"); + let html_no_source = matches.opt_present("html-no-source"); if generate_link_to_definition && (show_coverage || output_format != OutputFormat::Html) { diag.struct_err( @@ -769,6 +772,7 @@ impl Options { generate_link_to_definition, call_locations, no_emit_shared: false, + html_no_source, }; Ok((options, render_options)) } diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index d7ff248a9bf..bb1c186668c 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -463,6 +463,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> { generate_link_to_definition, call_locations, no_emit_shared, + html_no_source, .. } = options; @@ -488,7 +489,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> { scrape_examples_extension: !call_locations.is_empty(), }; let mut issue_tracker_base_url = None; - let mut include_sources = true; + let mut include_sources = !html_no_source; // Crawl the crate attributes looking for attributes which control how we're // going to emit HTML diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 8220df5d4f3..92e06f3ab0f 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -656,6 +656,9 @@ fn opts() -> Vec<RustcOptGroup> { "[rust]", ) }), + unstable("html-no-source", |o| { + o.optflag("", "html-no-source", "Disable HTML source code pages generation") + }), ] } |
