File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
compiler/rustc_codegen_llvm/src Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 11use crate :: base;
22use crate :: common:: { self , CodegenCx } ;
33use crate :: debuginfo;
4- use crate :: errors:: { InvalidMinimumAlignment , LinkageConstOrMutType } ;
4+ use crate :: errors:: { InvalidMinimumAlignment , LinkageConstOrMutType , SymbolAlreadyDefined } ;
55use crate :: llvm:: { self , True } ;
66use crate :: llvm_util;
77use crate :: type_:: Type ;
@@ -191,10 +191,10 @@ fn check_and_apply_linkage<'ll, 'tcx>(
191191 let mut real_name = "_rust_extern_with_linkage_" . to_string ( ) ;
192192 real_name. push_str ( sym) ;
193193 let g2 = cx. define_global ( & real_name, llty) . unwrap_or_else ( || {
194- cx. sess ( ) . span_fatal (
195- cx. tcx . def_span ( def_id) ,
196- & format ! ( "symbol `{}` is already defined" , & sym) ,
197- )
194+ cx. sess ( ) . emit_fatal ( SymbolAlreadyDefined {
195+ span : cx. tcx . def_span ( def_id) ,
196+ symbol_name : sym,
197+ } )
198198 } ) ;
199199 llvm:: LLVMRustSetLinkage ( g2, llvm:: Linkage :: InternalLinkage ) ;
200200 llvm:: LLVMSetInitializer ( g2, g1) ;
You can’t perform that action at this time.
0 commit comments