提交 e6072a7b 编写于 作者: B bors

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

Remove deprecated unstable attribute #[simd]

The `#[simd]` attribute has been deprecated since c8b6d5b2 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
......@@ -1553,11 +1553,6 @@ pub fn new(tcx: TyCtxt, did: DefId) -> 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);
......
......@@ -131,7 +131,6 @@ pub fn new() -> 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
......@@ -473,6 +472,8 @@ pub fn new() -> 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! (
......@@ -636,7 +637,6 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
("start", Normal, Ungated),
("test", Normal, Ungated),
("bench", Normal, Ungated),
("simd", Normal, Ungated),
("repr", Normal, Ungated),
("path", Normal, Ungated),
("abi", Normal, Ungated),
......@@ -1511,14 +1511,6 @@ fn visit_item(&mut self, i: &'a ast::Item) {
}
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") {
......
......@@ -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
......@@ -328,24 +327,6 @@ mod inner { #![bench="4100"] }
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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册