Skip to content

Commit c3b73ce

Browse files
committed
adding extra error message
1 parent 095eabd commit c3b73ce

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

compiler/rustc_ast/src/expand/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use rustc_span::{def_id::DefId, symbol::Ident};
55
use crate::MetaItem;
66

77
pub mod allocator;
8+
pub mod typetree;
9+
pub mod autodiff_attrs;
810

911
#[derive(Debug, Clone, Encodable, Decodable, HashStable_Generic)]
1012
pub struct StrippedCfgItem<ModId = DefId> {

compiler/rustc_codegen_llvm/messages.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ codegen_llvm_prepare_thin_lto_module_with_llvm_err = failed to prepare thin LTO
6060
codegen_llvm_run_passes = failed to run LLVM passes
6161
codegen_llvm_run_passes_with_llvm_err = failed to run LLVM passes: {$llvm_err}
6262
63+
codegen_llvm_prepare_autodiff = failed to prepare AutoDiff: src: {$src}, target: {$target}, {$error}
64+
codegen_llvm_prepare_autodiff_with_llvm_err = failed to prepare AutoDiff: {$llvm_err}, src: {$src}, target: {$target}, {$error}
65+
6366
codegen_llvm_sanitizer_memtag_requires_mte =
6467
`-Zsanitizer=memtag` requires `-Ctarget-feature=+mte`
6568

compiler/rustc_codegen_llvm/src/errors.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ pub enum LlvmError<'a> {
182182
PrepareThinLtoModule,
183183
#[diag(codegen_llvm_parse_bitcode)]
184184
ParseBitcode,
185+
#[diag(codegen_llvm_prepare_autodiff)]
186+
PrepareAutoDiff {
187+
src: String,
188+
target: String,
189+
error: String,
190+
},
185191
}
186192

187193
pub(crate) struct WithLlvmError<'a>(pub LlvmError<'a>, pub String);
@@ -203,6 +209,9 @@ impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for WithLlvmError<'_> {
203209
}
204210
PrepareThinLtoModule => fluent::codegen_llvm_prepare_thin_lto_module_with_llvm_err,
205211
ParseBitcode => fluent::codegen_llvm_parse_bitcode_with_llvm_err,
212+
PrepareAutoDiff { .. } => {
213+
fluent::codegen_llvm_prepare_autodiff_with_llvm_err
214+
}
206215
};
207216
let mut diag = self.0.into_diagnostic(dcx, level);
208217
diag.set_primary_message(msg_with_llvm_err);

0 commit comments

Comments
 (0)