@@ -177,6 +177,9 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
177
177
// Allows macros to appear in the type position.
178
178
179
179
( "type_macros" , "1.3.0" , Active ) ,
180
+
181
+ // allow `repr(simd)`, and importing the various simd intrinsics
182
+ ( "simd_basics" , "1.3.0" , Active ) ,
180
183
] ;
181
184
// (changing above list without updating src/doc/reference.md makes @cmr sad)
182
185
@@ -359,6 +362,7 @@ pub struct Features {
359
362
pub allow_box : bool ,
360
363
pub allow_pushpop_unsafe : bool ,
361
364
pub simd_ffi : bool ,
365
+ pub simd_basics : bool ,
362
366
pub unmarked_api : bool ,
363
367
pub negate_unsigned : bool ,
364
368
/// spans of #![feature] attrs for stable language features. for error reporting
@@ -388,6 +392,7 @@ impl Features {
388
392
allow_box : false ,
389
393
allow_pushpop_unsafe : false ,
390
394
simd_ffi : false ,
395
+ simd_basics : false ,
391
396
unmarked_api : false ,
392
397
negate_unsigned : false ,
393
398
declared_stable_lang_features : Vec :: new ( ) ,
@@ -660,6 +665,20 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
660
665
if attr:: contains_name ( & i. attrs [ ..] , "simd" ) {
661
666
self . gate_feature ( "simd" , i. span ,
662
667
"SIMD types are experimental and possibly buggy" ) ;
668
+ self . context . span_handler . span_warn ( i. span ,
669
+ "the `#[simd]` attribute is deprecated, \
670
+ use `#[repr(simd)]` instead") ;
671
+ }
672
+ for attr in & i. attrs {
673
+ if attr. name ( ) == "repr" {
674
+ for item in attr. meta_item_list ( ) . unwrap_or ( & [ ] ) {
675
+ if item. name ( ) == "simd" {
676
+ self . gate_feature ( "simd_basics" , i. span ,
677
+ "SIMD types are experimental and possibly buggy" ) ;
678
+
679
+ }
680
+ }
681
+ }
663
682
}
664
683
}
665
684
@@ -892,6 +911,7 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler,
892
911
allow_box : cx. has_feature ( "box_syntax" ) ,
893
912
allow_pushpop_unsafe : cx. has_feature ( "pushpop_unsafe" ) ,
894
913
simd_ffi : cx. has_feature ( "simd_ffi" ) ,
914
+ simd_basics : cx. has_feature ( "simd_basics" ) ,
895
915
unmarked_api : cx. has_feature ( "unmarked_api" ) ,
896
916
negate_unsigned : cx. has_feature ( "negate_unsigned" ) ,
897
917
declared_stable_lang_features : accepted_features,
0 commit comments