Skip to content

Commit ec1e101

Browse files
committed
Fix diag() and formatting
1 parent 9f0c165 commit ec1e101

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/rustc_codegen_llvm/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub(crate) struct ErrorCreatingImportLibrary<'a> {
4949
pub(crate) struct InstrumentCoverageRequiresLLVM12;
5050

5151
#[derive(SessionDiagnostic)]
52-
#[diag(codegen_llvm::SymbolAlreadyDefined)]
52+
#[diag(codegen_llvm::symbol_already_defined)]
5353
pub(crate) struct SymbolAlreadyDefined<'a> {
5454
#[primary_span]
5555
pub span: Span,

compiler/rustc_codegen_llvm/src/mono_item.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::attributes;
22
use crate::base;
33
use crate::context::CodegenCx;
4+
use crate::errors::SymbolAlreadyDefined;
45
use crate::llvm;
56
use crate::type_of::LayoutLlvmExt;
67
use rustc_codegen_ssa::traits::*;
@@ -25,7 +26,8 @@ impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'_, 'tcx> {
2526
let llty = self.layout_of(ty).llvm_type(self);
2627

2728
let g = self.define_global(symbol_name, llty).unwrap_or_else(|| {
28-
self.sess().emit_fatal(SymbolAlreadyDefined { span: self.tcx.def_span(def_id), symbol_name })
29+
self.sess()
30+
.emit_fatal(SymbolAlreadyDefined { span: self.tcx.def_span(def_id), symbol_name })
2931
});
3032

3133
unsafe {

0 commit comments

Comments
 (0)