@@ -902,7 +902,7 @@ static AVR_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
902902 ( "rmw" , Unstable ( sym:: avr_target_feature) , & [ ] ) ,
903903 ( "spm" , Unstable ( sym:: avr_target_feature) , & [ ] ) ,
904904 ( "spmx" , Unstable ( sym:: avr_target_feature) , & [ ] ) ,
905- ( "sram" , Unstable ( sym :: avr_target_feature ) , & [ ] ) ,
905+ ( "sram" , Forbidden { reason : "minimum requirement for Rust/C/C++" } , & [ ] ) ,
906906 ( "tinyencoding" , Unstable ( sym:: avr_target_feature) , & [ ] ) ,
907907 // tidy-alphabetical-end
908908] ;
@@ -1038,11 +1038,7 @@ impl Target {
10381038 Arch :: CSky => CSKY_FEATURES_FOR_CORRECT_FIXED_LENGTH_VECTOR_ABI ,
10391039 // FIXME: for some tier3 targets, we are overly cautious and always give warnings
10401040 // when passing args in vector registers.
1041- Arch :: Msp430
1042- | Arch :: PowerPC64LE
1043- | Arch :: SpirV
1044- | Arch :: Xtensa
1045- | Arch :: Other ( _) => & [ ] ,
1041+ Arch :: Msp430 | Arch :: PowerPC64LE | Arch :: SpirV | Arch :: Xtensa | Arch :: Other ( _) => & [ ] ,
10461042 }
10471043 }
10481044
@@ -1239,6 +1235,12 @@ impl Target {
12391235 // because the vector and float registers overlap.
12401236 FeatureConstraints { required : & [ ] , incompatible : & [ "soft-float" ] }
12411237 }
1238+ Arch :: Avr => {
1239+ // SRAM is minimum requirement for C/C++ in both avr-gcc and clang,
1240+ // and backends of them only support assembly for devices have no SRAM.
1241+ // See the discussion in https://github.com/rust-lang/rust/pull/146900 for more.
1242+ FeatureConstraints { required : & [ "sram" ] , incompatible : & [ ] }
1243+ }
12421244 _ => NOTHING ,
12431245 }
12441246 }
0 commit comments