File tree 1 file changed +5
-5
lines changed
compiler/rustc_codegen_llvm/src
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: base;
2
2
use crate :: common:: { self , CodegenCx } ;
3
3
use crate :: debuginfo;
4
- use crate :: errors:: { InvalidMinimumAlignment , LinkageConstOrMutType } ;
4
+ use crate :: errors:: { InvalidMinimumAlignment , LinkageConstOrMutType , SymbolAlreadyDefined } ;
5
5
use crate :: llvm:: { self , True } ;
6
6
use crate :: llvm_util;
7
7
use crate :: type_:: Type ;
@@ -191,10 +191,10 @@ fn check_and_apply_linkage<'ll, 'tcx>(
191
191
let mut real_name = "_rust_extern_with_linkage_" . to_string ( ) ;
192
192
real_name. push_str ( sym) ;
193
193
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
+ } )
198
198
} ) ;
199
199
llvm:: LLVMRustSetLinkage ( g2, llvm:: Linkage :: InternalLinkage ) ;
200
200
llvm:: LLVMSetInitializer ( g2, g1) ;
You can’t perform that action at this time.
0 commit comments