Implement repr(simd) as an alias for #[simd].

This commit is contained in:
Huon Wilson
2015-07-13 11:35:00 -07:00
parent e822a18ae7
commit c8b6d5b23c
7 changed files with 48 additions and 4 deletions

View File

@@ -579,6 +579,7 @@ pub fn find_repr_attrs(diagnostic: &SpanHandler, attr: &Attribute) -> Vec<ReprAt
// Can't use "extern" because it's not a lexical identifier.
"C" => Some(ReprExtern),
"packed" => Some(ReprPacked),
"simd" => Some(ReprSimd),
_ => match int_type_of_word(&word) {
Some(ity) => Some(ReprInt(item.span, ity)),
None => {
@@ -628,6 +629,7 @@ pub enum ReprAttr {
ReprInt(Span, IntType),
ReprExtern,
ReprPacked,
ReprSimd,
}
impl ReprAttr {
@@ -636,7 +638,8 @@ impl ReprAttr {
ReprAny => false,
ReprInt(_sp, ity) => ity.is_ffi_safe(),
ReprExtern => true,
ReprPacked => false
ReprPacked => false,
ReprSimd => true,
}
}
}