Skip to content

Commit 7e5acb9

Browse files
committed
Add note mentioning the event log to LinkExeStatusStackBufferOverrun
1 parent b60f75c commit 7e5acb9

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
@@ -179,7 +179,8 @@ codegen_ssa_ld64_unimplemented_modifier = `as-needed` modifier not implemented y
179179
codegen_ssa_lib_def_write_failure = failed to write lib.def file: {$error}
180180
181181
codegen_ssa_link_exe_status_stack_buffer_overrun = 0xc0000409 is `STATUS_STACK_BUFFER_OVERRUN`
182-
.note = this may have been caused by a program abort and not a stack buffer overrun
182+
.abort_note = this may have been caused by a program abort and not a stack buffer overrun
183+
.event_log_note = consider checking the Application Event Log for Windows Error Reporting events to see the fail fast error code
183184
184185
codegen_ssa_link_exe_unexpected_error = `link.exe` returned an unexpected error
185186

compiler/rustc_codegen_ssa/src/errors.rs

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

553-
#[derive(Diagnostic)]
554-
#[diag(codegen_ssa_link_exe_status_stack_buffer_overrun)]
555-
#[note]
556553
pub(crate) struct LinkExeStatusStackBufferOverrun;
557554

555+
impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for LinkExeStatusStackBufferOverrun {
556+
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
557+
let mut diag =
558+
Diag::new(dcx, level, fluent::codegen_ssa_link_exe_status_stack_buffer_overrun);
559+
diag.note(fluent::codegen_ssa_abort_note);
560+
diag.note(fluent::codegen_ssa_event_log_note);
561+
diag
562+
}
563+
}
564+
558565
#[derive(Diagnostic)]
559566
#[diag(codegen_ssa_repair_vs_build_tools)]
560567
pub(crate) struct RepairVSBuildTools;

0 commit comments

Comments
 (0)