Skip to content

Commit 95c3fc0

Browse files
author
Robin Kruppe
committed
Remove deprecated unstable attribute #[simd]
The `#[simd]` attribute has been deprecated since c8b6d5b 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.
1 parent 6828cf9 commit 95c3fc0

File tree

4 files changed

+413
-481
lines changed

4 files changed

+413
-481
lines changed

src/librustc/ty/mod.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1553,11 +1553,6 @@ impl ReprOptions {
15531553
}
15541554
}
15551555

1556-
// FIXME(eddyb) This is deprecated and should be removed.
1557-
if tcx.has_attr(did, "simd") {
1558-
flags.insert(ReprFlags::IS_SIMD);
1559-
}
1560-
15611556
// This is here instead of layout because the choice must make it into metadata.
15621557
if !tcx.consider_optimizing(|| format!("Reorder fields of {:?}", tcx.item_path_str(did))) {
15631558
flags.insert(ReprFlags::IS_LINEAR);

src/libsyntax/feature_gate.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ declare_features! (
131131
(active, link_llvm_intrinsics, "1.0.0", Some(29602)),
132132
(active, linkage, "1.0.0", Some(29603)),
133133
(active, quote, "1.0.0", Some(29601)),
134-
(active, simd, "1.0.0", Some(27731)),
135134

136135

137136
// rustc internal
@@ -470,6 +469,8 @@ declare_features! (
470469
(removed, unmarked_api, "1.0.0", None),
471470
(removed, pushpop_unsafe, "1.2.0", None),
472471
(removed, allocator, "1.0.0", None),
472+
// Allows the `#[simd]` attribute -- removed in favor of `#[repr(simd)]`
473+
(removed, simd, "1.0.0", Some(27731)),
473474
);
474475

475476
declare_features! (
@@ -633,7 +634,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
633634
("start", Normal, Ungated),
634635
("test", Normal, Ungated),
635636
("bench", Normal, Ungated),
636-
("simd", Normal, Ungated),
637637
("repr", Normal, Ungated),
638638
("path", Normal, Ungated),
639639
("abi", Normal, Ungated),
@@ -1501,14 +1501,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
15011501
}
15021502

15031503
ast::ItemKind::Struct(..) => {
1504-
if let Some(attr) = attr::find_by_name(&i.attrs[..], "simd") {
1505-
gate_feature_post!(&self, simd, attr.span,
1506-
"SIMD types are experimental and possibly buggy");
1507-
self.context.parse_sess.span_diagnostic.span_warn(attr.span,
1508-
"the `#[simd]` attribute \
1509-
is deprecated, use \
1510-
`#[repr(simd)]` instead");
1511-
}
15121504
if let Some(attr) = attr::find_by_name(&i.attrs[..], "repr") {
15131505
for item in attr.meta_item_list().unwrap_or_else(Vec::new) {
15141506
if item.check_name("simd") {

src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs

-19
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
#![start = "x4300"] //~ WARN unused attribute
6161
// see issue-43106-gating-of-test.rs for crate-level; but non crate-level is below at "4200"
6262
// see issue-43106-gating-of-bench.rs for crate-level; but non crate-level is below at "4100"
63-
#![simd = "4000"] //~ WARN unused attribute
6463
#![repr = "3900"] //~ WARN unused attribute
6564
#![path = "3800"] //~ WARN unused attribute
6665
#![abi = "3700"] //~ WARN unused attribute
@@ -328,24 +327,6 @@ mod bench {
328327
impl S { }
329328
}
330329

331-
#[simd = "4000"]
332-
//~^ WARN unused attribute
333-
mod simd {
334-
mod inner { #![simd="4000"] }
335-
//~^ WARN unused attribute
336-
337-
#[simd = "4000"] fn f() { }
338-
//~^ WARN unused attribute
339-
340-
struct S; // for `struct S` case, see feature-gate-repr-simd.rs
341-
342-
#[simd = "4000"] type T = S;
343-
//~^ WARN unused attribute
344-
345-
#[simd = "4000"] impl S { }
346-
//~^ WARN unused attribute
347-
}
348-
349330
#[repr = "3900"]
350331
//~^ WARN unused attribute
351332
mod repr {

0 commit comments

Comments
 (0)