提交 95c3fc05 编写于 作者: R Robin Kruppe

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.
上级 6828cf90
...@@ -1553,11 +1553,6 @@ pub fn new(tcx: TyCtxt, did: DefId) -> ReprOptions { ...@@ -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. // 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);
......
...@@ -131,7 +131,6 @@ pub fn new() -> Features { ...@@ -131,7 +131,6 @@ pub fn new() -> 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
...@@ -470,6 +469,8 @@ pub fn new() -> Features { ...@@ -470,6 +469,8 @@ pub fn new() -> 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! (
...@@ -633,7 +634,6 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool { ...@@ -633,7 +634,6 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
("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),
...@@ -1501,14 +1501,6 @@ fn visit_item(&mut self, i: &'a ast::Item) { ...@@ -1501,14 +1501,6 @@ fn visit_item(&mut self, i: &'a ast::Item) {
} }
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") {
......
...@@ -60,7 +60,6 @@ ...@@ -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 inner { #![bench="4100"] } ...@@ -328,24 +327,6 @@ mod inner { #![bench="4100"] }
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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册