diff options
| author | SLASHLogin <loginmlgxd@gmail.com> | 2022-08-25 23:47:11 +0200 |
|---|---|---|
| committer | SLASHLogin <loginmlgxd@gmail.com> | 2022-11-09 14:56:20 +0100 |
| commit | ec1e101e1b845579eaaed164b096ae3784f3479d (patch) | |
| tree | fafe01e95eb03ac8225906eaac660ecf1b63ec00 /compiler/rustc_codegen_llvm/src | |
| parent | 9f0c16576b9e094e84ec833a51a908ae5ff24d33 (diff) | |
| download | rust-ec1e101e1b845579eaaed164b096ae3784f3479d.tar.gz rust-ec1e101e1b845579eaaed164b096ae3784f3479d.zip | |
Fix diag() and formatting
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/mono_item.rs | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/errors.rs b/compiler/rustc_codegen_llvm/src/errors.rs index 34b2c844f50..ed435e555d7 100644 --- a/compiler/rustc_codegen_llvm/src/errors.rs +++ b/compiler/rustc_codegen_llvm/src/errors.rs @@ -49,7 +49,7 @@ pub(crate) struct ErrorCreatingImportLibrary<'a> { pub(crate) struct InstrumentCoverageRequiresLLVM12; #[derive(SessionDiagnostic)] -#[diag(codegen_llvm::SymbolAlreadyDefined)] +#[diag(codegen_llvm::symbol_already_defined)] pub(crate) struct SymbolAlreadyDefined<'a> { #[primary_span] pub span: Span, diff --git a/compiler/rustc_codegen_llvm/src/mono_item.rs b/compiler/rustc_codegen_llvm/src/mono_item.rs index d5096873c43..76f692b2016 100644 --- a/compiler/rustc_codegen_llvm/src/mono_item.rs +++ b/compiler/rustc_codegen_llvm/src/mono_item.rs @@ -1,6 +1,7 @@ use crate::attributes; use crate::base; use crate::context::CodegenCx; +use crate::errors::SymbolAlreadyDefined; use crate::llvm; use crate::type_of::LayoutLlvmExt; use rustc_codegen_ssa::traits::*; @@ -25,7 +26,8 @@ impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'_, 'tcx> { let llty = self.layout_of(ty).llvm_type(self); let g = self.define_global(symbol_name, llty).unwrap_or_else(|| { - self.sess().emit_fatal(SymbolAlreadyDefined { span: self.tcx.def_span(def_id), symbol_name }) + self.sess() + .emit_fatal(SymbolAlreadyDefined { span: self.tcx.def_span(def_id), symbol_name }) }); unsafe { |
