File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
rustc_error_messages/locales/en-US Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use crate::back::write::to_llvm_code_model;
3
3
use crate :: callee:: get_fn;
4
4
use crate :: coverageinfo;
5
5
use crate :: debuginfo;
6
+ use crate :: errors:: BranchProtectionRequiresAArch64 ;
6
7
use crate :: llvm;
7
8
use crate :: llvm_util;
8
9
use crate :: type_:: Type ;
@@ -275,7 +276,7 @@ pub unsafe fn create_module<'ll>(
275
276
276
277
if let Some ( BranchProtection { bti, pac_ret } ) = sess. opts . unstable_opts . branch_protection {
277
278
if sess. target . arch != "aarch64" {
278
- sess. err ( "-Zbranch-protection is only supported on aarch64" ) ;
279
+ sess. emit_err ( BranchProtectionRequiresAArch64 ) ;
279
280
} else {
280
281
llvm:: LLVMRustAddModuleFlag (
281
282
llmod,
Original file line number Diff line number Diff line change @@ -55,3 +55,7 @@ pub(crate) struct SymbolAlreadyDefined<'a> {
55
55
pub span : Span ,
56
56
pub symbol_name : & ' a str ,
57
57
}
58
+
59
+ #[ derive( SessionDiagnostic ) ]
60
+ #[ diag( codegen_llvm:: branch_protection_requires_aarch64) ]
61
+ pub ( crate ) struct BranchProtectionRequiresAArch64 ;
Original file line number Diff line number Diff line change @@ -21,3 +21,6 @@ codegen_llvm_instrument_coverage_requires_llvm_12 =
21
21
22
22
codegen_llvm_symbol_already_defined =
23
23
symbol `{ $symbol_name } ` is already defined
24
+
25
+ codegen_llvm_branch_protection_requires_aarch64 =
26
+ -Zbranch-protection is only supported on aarch64
You can’t perform that action at this time.
0 commit comments