Skip to content

Commit fd5dcde

Browse files
committed
Add note mentioning the event log to LinkExeStatusStackBufferOverrun
1 parent 68cc85a commit fd5dcde

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

compiler/rustc_codegen_ssa/messages.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ codegen_ssa_ld64_unimplemented_modifier = `as-needed` modifier not implemented y
181181
codegen_ssa_lib_def_write_failure = failed to write lib.def file: {$error}
182182
183183
codegen_ssa_link_exe_status_stack_buffer_overrun = 0xc0000409 is `STATUS_STACK_BUFFER_OVERRUN`
184-
.note = this may have been caused by a program abort and not a stack buffer overrun
184+
.abort_note = this may have been caused by a program abort and not a stack buffer overrun
185+
.event_log_note = consider checking the Application Event Log for Windows Error Reporting events to see the fail fast error code
185186
186187
codegen_ssa_link_exe_unexpected_error = `link.exe` returned an unexpected error
187188

compiler/rustc_codegen_ssa/src/errors.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,18 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for LinkingFailed<'_> {
579579
#[diag(codegen_ssa_link_exe_unexpected_error)]
580580
pub(crate) struct LinkExeUnexpectedError;
581581

582-
#[derive(Diagnostic)]
583-
#[diag(codegen_ssa_link_exe_status_stack_buffer_overrun)]
584-
#[note]
585582
pub(crate) struct LinkExeStatusStackBufferOverrun;
586583

584+
impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for LinkExeStatusStackBufferOverrun {
585+
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
586+
let mut diag =
587+
Diag::new(dcx, level, fluent::codegen_ssa_link_exe_status_stack_buffer_overrun);
588+
diag.note(fluent::codegen_ssa_abort_note);
589+
diag.note(fluent::codegen_ssa_event_log_note);
590+
diag
591+
}
592+
}
593+
587594
#[derive(Diagnostic)]
588595
#[diag(codegen_ssa_repair_vs_build_tools)]
589596
pub(crate) struct RepairVSBuildTools;

0 commit comments

Comments
 (0)