@@ -43,7 +43,7 @@ use rustc_session::Session;
4343use rustc_session:: config:: { CrateType , OutputFilenames , OutputType } ;
4444use rustc_session:: output:: out_filename;
4545use rustc_span:: { Symbol , sym} ;
46- use rustc_target:: spec:: PanicStrategy ;
46+ use rustc_target:: spec:: { Arch , PanicStrategy } ;
4747use std:: any:: Any ;
4848use std:: cmp:: min;
4949use std:: collections:: BTreeMap ;
@@ -302,10 +302,10 @@ impl CodegenBackend for GotocCodegenBackend {
302302 fn target_config ( & self , sess : & Session ) -> TargetConfig {
303303 // This code is adapted from the cranelift backend:
304304 // https://github.com/rust-lang/rust/blob/a124fb3cb7291d75872934f411d81fe298379ace/compiler/rustc_codegen_cranelift/src/lib.rs#L184
305- let target_features = if sess. target . arch == "x86_64" && sess. target . os != "none" {
305+ let target_features = if sess. target . arch == Arch :: X86_64 && sess. target . os != "none" {
306306 // x86_64 mandates SSE2 support and rustc requires the x87 feature to be enabled
307307 vec ! [ sym:: sse, sym:: sse2, Symbol :: intern( "x87" ) ]
308- } else if sess. target . arch == "aarch64" {
308+ } else if sess. target . arch == Arch :: AArch64 {
309309 match & * sess. target . os {
310310 "none" => vec ! [ ] ,
311311 // On macOS the aes, sha2 and sha3 features are enabled by default and ring
@@ -801,8 +801,8 @@ fn new_machine_model(sess: &Session) -> MachineModel {
801801 // see /tools/sizeofs/main.cpp.
802802 // For reference, the definition in CBMC:
803803 //https://github.com/diffblue/cbmc/blob/develop/src/util/config.cpp
804- match architecture. as_ref ( ) {
805- "x86_64" => {
804+ match architecture {
805+ Arch :: X86_64 => {
806806 let bool_width = 8 ;
807807 let char_is_unsigned = false ;
808808 let char_width = 8 ;
@@ -841,7 +841,7 @@ fn new_machine_model(sess: &Session) -> MachineModel {
841841 word_size : int_width,
842842 }
843843 }
844- "aarch64" => {
844+ Arch :: AArch64 => {
845845 let bool_width = 8 ;
846846 let char_is_unsigned = true ;
847847 let char_width = 8 ;
0 commit comments