@@ -915,7 +915,7 @@ static AVR_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
915915 ( "rmw" , Unstable ( sym:: avr_target_feature) , & [ ] ) ,
916916 ( "spm" , Unstable ( sym:: avr_target_feature) , & [ ] ) ,
917917 ( "spmx" , Unstable ( sym:: avr_target_feature) , & [ ] ) ,
918- ( "sram" , Unstable ( sym :: avr_target_feature ) , & [ ] ) ,
918+ ( "sram" , Forbidden { reason : "devices that have no SRAM are unsupported" } , & [ ] ) ,
919919 ( "tinyencoding" , Unstable ( sym:: avr_target_feature) , & [ ] ) ,
920920 // tidy-alphabetical-end
921921] ;
@@ -1020,11 +1020,7 @@ impl Target {
10201020 Arch :: Sparc | Arch :: Sparc64 => SPARC_FEATURES ,
10211021 Arch :: M68k => M68K_FEATURES ,
10221022 Arch :: Avr => AVR_FEATURES ,
1023- Arch :: AmdGpu
1024- | Arch :: Msp430
1025- | Arch :: SpirV
1026- | Arch :: Xtensa
1027- | Arch :: Other ( _) => & [ ] ,
1023+ Arch :: AmdGpu | Arch :: Msp430 | Arch :: SpirV | Arch :: Xtensa | Arch :: Other ( _) => & [ ] ,
10281024 }
10291025 }
10301026
@@ -1247,6 +1243,12 @@ impl Target {
12471243 // because the vector and float registers overlap.
12481244 FeatureConstraints { required : & [ ] , incompatible : & [ "soft-float" ] }
12491245 }
1246+ Arch :: Avr => {
1247+ // SRAM is minimum requirement for C/C++ in both avr-gcc and Clang,
1248+ // and backends of them only support assembly for devices have no SRAM.
1249+ // See the discussion in https://github.com/rust-lang/rust/pull/146900 for more.
1250+ FeatureConstraints { required : & [ "sram" ] , incompatible : & [ ] }
1251+ }
12501252 _ => NOTHING ,
12511253 }
12521254 }
0 commit comments