Skip to content

Commit e6072a7

Browse files
committed
Auto merge of #47251 - rkruppe:rm-simd-attr, r=eddyb
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. r? @eddyb
2 parents 9b2f8ac + 95c3fc0 commit e6072a7

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
@@ -473,6 +472,8 @@ declare_features! (
473472
(removed, unmarked_api, "1.0.0", None),
474473
(removed, pushpop_unsafe, "1.2.0", None),
475474
(removed, allocator, "1.0.0", None),
475+
// Allows the `#[simd]` attribute -- removed in favor of `#[repr(simd)]`
476+
(removed, simd, "1.0.0", Some(27731)),
476477
);
477478

478479
declare_features! (
@@ -636,7 +637,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
636637
("start", Normal, Ungated),
637638
("test", Normal, Ungated),
638639
("bench", Normal, Ungated),
639-
("simd", Normal, Ungated),
640640
("repr", Normal, Ungated),
641641
("path", Normal, Ungated),
642642
("abi", Normal, Ungated),
@@ -1511,14 +1511,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
15111511
}
15121512

15131513
ast::ItemKind::Struct(..) => {
1514-
if let Some(attr) = attr::find_by_name(&i.attrs[..], "simd") {
1515-
gate_feature_post!(&self, simd, attr.span,
1516-
"SIMD types are experimental and possibly buggy");
1517-
self.context.parse_sess.span_diagnostic.span_warn(attr.span,
1518-
"the `#[simd]` attribute \
1519-
is deprecated, use \
1520-
`#[repr(simd)]` instead");
1521-
}
15221514
if let Some(attr) = attr::find_by_name(&i.attrs[..], "repr") {
15231515
for item in attr.meta_item_list().unwrap_or_else(Vec::new) {
15241516
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)