Skip to content

Commit 0426562

Browse files
committed
very minor cleanups
- add `must_use` to `early_error_no_abort` this was already being used at its only callsite, but this ensures that new code remembers to use it if it's called in the future. - remove outdated and incorrect comment in `builder.rs`. `doc_rust_lang_org_channel` doesn't exist in rustdoc, it gets it from an env var instead.
1 parent ba6f5e3 commit 0426562

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

compiler/rustc_driver_impl/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,8 @@ pub fn install_ice_hook(bug_report_url: &'static str, extra_info: fn(&Handler))
12501250
#[cfg(windows)]
12511251
if let Some(msg) = info.payload().downcast_ref::<String>() {
12521252
if msg.starts_with("failed printing to stdout: ") && msg.ends_with("(os error 232)") {
1253-
early_error_no_abort(ErrorOutputType::default(), msg.as_str());
1253+
// the error code is already going to be reported when the panic unwinds up the stack
1254+
let _ = early_error_no_abort(ErrorOutputType::default(), msg.as_str());
12541255
return;
12551256
}
12561257
};

compiler/rustc_session/src/session.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,7 @@ fn early_error_handler(output: config::ErrorOutputType) -> rustc_errors::Handler
17271727

17281728
#[allow(rustc::untranslatable_diagnostic)]
17291729
#[allow(rustc::diagnostic_outside_of_impl)]
1730+
#[must_use = "ErrorGuaranteed must be returned from `run_compiler` in order to exit with a non-zero status code"]
17301731
pub fn early_error_no_abort(
17311732
output: config::ErrorOutputType,
17321733
msg: impl Into<DiagnosticMessage>,

src/bootstrap/builder.rs

-1
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,6 @@ impl<'a> Builder<'a> {
942942
self.run_step_descriptions(&Builder::get_step_descriptions(Kind::Doc), paths);
943943
}
944944

945-
/// NOTE: keep this in sync with `rustdoc::clean::utils::doc_rust_lang_org_channel`, or tests will fail on beta/stable.
946945
pub fn doc_rust_lang_org_channel(&self) -> String {
947946
let channel = match &*self.config.channel {
948947
"stable" => &self.version,

0 commit comments

Comments
 (0)