1
Fork 0

Auto merge of #47251 - rkruppe:rm-simd-attr, r=eddyb

Remove deprecated unstable attribute #[simd]

The `#[simd]` attribute has been deprecated since c8b6d5b23c back in 2015. Any nightly crates using it have had ample time to switch to `#[repr(simd)]`, and if they didn't they're likely broken by now anyway.

r? @eddyb
This commit is contained in:
bors 2018-01-13 15:29:31 +00:00
commit e6072a7b38
4 changed files with 463 additions and 531 deletions

View file

@ -1553,11 +1553,6 @@ impl ReprOptions {
} }
} }
// FIXME(eddyb) This is deprecated and should be removed.
if tcx.has_attr(did, "simd") {
flags.insert(ReprFlags::IS_SIMD);
}
// This is here instead of layout because the choice must make it into metadata. // This is here instead of layout because the choice must make it into metadata.
if !tcx.consider_optimizing(|| format!("Reorder fields of {:?}", tcx.item_path_str(did))) { if !tcx.consider_optimizing(|| format!("Reorder fields of {:?}", tcx.item_path_str(did))) {
flags.insert(ReprFlags::IS_LINEAR); flags.insert(ReprFlags::IS_LINEAR);

View file

@ -131,7 +131,6 @@ declare_features! (
(active, link_llvm_intrinsics, "1.0.0", Some(29602)), (active, link_llvm_intrinsics, "1.0.0", Some(29602)),
(active, linkage, "1.0.0", Some(29603)), (active, linkage, "1.0.0", Some(29603)),
(active, quote, "1.0.0", Some(29601)), (active, quote, "1.0.0", Some(29601)),
(active, simd, "1.0.0", Some(27731)),
// rustc internal // rustc internal
@ -473,6 +472,8 @@ declare_features! (
(removed, unmarked_api, "1.0.0", None), (removed, unmarked_api, "1.0.0", None),
(removed, pushpop_unsafe, "1.2.0", None), (removed, pushpop_unsafe, "1.2.0", None),
(removed, allocator, "1.0.0", None), (removed, allocator, "1.0.0", None),
// Allows the `#[simd]` attribute -- removed in favor of `#[repr(simd)]`
(removed, simd, "1.0.0", Some(27731)),
); );
declare_features! ( declare_features! (
@ -636,7 +637,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
("start", Normal, Ungated), ("start", Normal, Ungated),
("test", Normal, Ungated), ("test", Normal, Ungated),
("bench", Normal, Ungated), ("bench", Normal, Ungated),
("simd", Normal, Ungated),
("repr", Normal, Ungated), ("repr", Normal, Ungated),
("path", Normal, Ungated), ("path", Normal, Ungated),
("abi", Normal, Ungated), ("abi", Normal, Ungated),
@ -1511,14 +1511,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
} }
ast::ItemKind::Struct(..) => { ast::ItemKind::Struct(..) => {
if let Some(attr) = attr::find_by_name(&i.attrs[..], "simd") {
gate_feature_post!(&self, simd, attr.span,
"SIMD types are experimental and possibly buggy");
self.context.parse_sess.span_diagnostic.span_warn(attr.span,
"the `#[simd]` attribute \
is deprecated, use \
`#[repr(simd)]` instead");
}
if let Some(attr) = attr::find_by_name(&i.attrs[..], "repr") { if let Some(attr) = attr::find_by_name(&i.attrs[..], "repr") {
for item in attr.meta_item_list().unwrap_or_else(Vec::new) { for item in attr.meta_item_list().unwrap_or_else(Vec::new) {
if item.check_name("simd") { if item.check_name("simd") {

View file

@ -60,7 +60,6 @@
#![start = "x4300"] //~ WARN unused attribute #![start = "x4300"] //~ WARN unused attribute
// see issue-43106-gating-of-test.rs for crate-level; but non crate-level is below at "4200" // see issue-43106-gating-of-test.rs for crate-level; but non crate-level is below at "4200"
// see issue-43106-gating-of-bench.rs for crate-level; but non crate-level is below at "4100" // see issue-43106-gating-of-bench.rs for crate-level; but non crate-level is below at "4100"
#![simd = "4000"] //~ WARN unused attribute
#![repr = "3900"] //~ WARN unused attribute #![repr = "3900"] //~ WARN unused attribute
#![path = "3800"] //~ WARN unused attribute #![path = "3800"] //~ WARN unused attribute
#![abi = "3700"] //~ WARN unused attribute #![abi = "3700"] //~ WARN unused attribute
@ -328,24 +327,6 @@ mod bench {
impl S { } impl S { }
} }
#[simd = "4000"]
//~^ WARN unused attribute
mod simd {
mod inner { #![simd="4000"] }
//~^ WARN unused attribute
#[simd = "4000"] fn f() { }
//~^ WARN unused attribute
struct S; // for `struct S` case, see feature-gate-repr-simd.rs
#[simd = "4000"] type T = S;
//~^ WARN unused attribute
#[simd = "4000"] impl S { }
//~^ WARN unused attribute
}
#[repr = "3900"] #[repr = "3900"]
//~^ WARN unused attribute //~^ WARN unused attribute
mod repr { mod repr {