Skip to content

Commit

Permalink
Auto merge of #47251 - rkruppe:rm-simd-attr, r=eddyb
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Jan 13, 2018
2 parents 9b2f8ac + 95c3fc0 commit e6072a7
Show file tree
Hide file tree
Showing 4 changed files with 413 additions and 481 deletions.
5 changes: 0 additions & 5 deletions src/librustc/ty/mod.rs
Expand Up @@ -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.
if !tcx.consider_optimizing(|| format!("Reorder fields of {:?}", tcx.item_path_str(did))) {
flags.insert(ReprFlags::IS_LINEAR);
Expand Down
12 changes: 2 additions & 10 deletions src/libsyntax/feature_gate.rs
Expand Up @@ -131,7 +131,6 @@ declare_features! (
(active, link_llvm_intrinsics, "1.0.0", Some(29602)),
(active, linkage, "1.0.0", Some(29603)),
(active, quote, "1.0.0", Some(29601)),
(active, simd, "1.0.0", Some(27731)),


// rustc internal
Expand Down Expand Up @@ -473,6 +472,8 @@ declare_features! (
(removed, unmarked_api, "1.0.0", None),
(removed, pushpop_unsafe, "1.2.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! (
Expand Down Expand Up @@ -636,7 +637,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
("start", Normal, Ungated),
("test", Normal, Ungated),
("bench", Normal, Ungated),
("simd", Normal, Ungated),
("repr", Normal, Ungated),
("path", Normal, Ungated),
("abi", Normal, Ungated),
Expand Down Expand Up @@ -1511,14 +1511,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
}

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") {
for item in attr.meta_item_list().unwrap_or_else(Vec::new) {
if item.check_name("simd") {
Expand Down
19 changes: 0 additions & 19 deletions src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs
Expand Up @@ -60,7 +60,6 @@
#![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-bench.rs for crate-level; but non crate-level is below at "4100"
#![simd = "4000"] //~ WARN unused attribute
#![repr = "3900"] //~ WARN unused attribute
#![path = "3800"] //~ WARN unused attribute
#![abi = "3700"] //~ WARN unused attribute
Expand Down Expand Up @@ -328,24 +327,6 @@ mod bench {
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"]
//~^ WARN unused attribute
mod repr {
Expand Down

0 comments on commit e6072a7

Please sign in to comment.