提交 8cdad627 编写于 作者: S Steffen

add feature gate "abi_vectorcall" for the vectorcall calling convention

上级 9af75d2b
......@@ -479,6 +479,7 @@ are:
* `cdecl`
* `fastcall`
* `vectorcall`
This is currently hidden behind the `abi_vectorcall` gate and is subject to change.
* `Rust`
* `rust-intrinsic`
* `system`
......
......@@ -2390,6 +2390,9 @@ The currently implemented features of the reference compiler are:
* - `type_ascription` - Allows type ascription expressions `expr: Type`.
* - `abi_vectorcall` - Allows the usage of the vectorcall calling convention
(e.g. `extern "vectorcall" func fn_();`)
If a feature is promoted to a language feature, then all existing programs will
start to receive compilation warnings about `#![feature]` directives which enabled
the new feature (because the directive is no longer necessary). However, if a
......
......@@ -239,6 +239,9 @@
// Allows cfg(target_thread_local)
("cfg_target_thread_local", "1.7.0", Some(29594), Active),
// rustc internal
("abi_vectorcall", "1.7.0", None, Active)
];
// (changing above list without updating src/doc/reference.md makes @cmr sad)
......@@ -862,6 +865,11 @@ fn visit_item(&mut self, i: &ast::Item) {
Abi::PlatformIntrinsic => {
Some(("platform_intrinsics",
"platform intrinsics are experimental and possibly buggy"))
},
Abi::Vectorcall => {
Some(("abi_vectorcall",
"vectorcall is experimental and subject to change"
))
}
_ => None
};
......@@ -1033,11 +1041,17 @@ fn visit_fn(&mut self,
"intrinsics are subject to change")
}
FnKind::ItemFn(_, _, _, _, abi, _) |
FnKind::Method(_, &ast::MethodSig { abi, .. }, _) if abi == Abi::RustCall => {
self.gate_feature("unboxed_closures",
span,
"rust-call ABI is subject to change")
}
FnKind::Method(_, &ast::MethodSig { abi, .. }, _) => match abi {
Abi::RustCall => {
self.gate_feature("unboxed_closures", span,
"rust-call ABI is subject to change");
},
Abi::Vectorcall => {
self.gate_feature("abi_vectorcall", span,
"vectorcall is experimental and subject to change");
},
_ => {}
},
_ => {}
}
visit::walk_fn(self, fn_kind, fn_decl, block, span);
......
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern "vectorcall" { //~ ERROR vectorcall is experimental and subject to change
fn bar();
}
extern "vectorcall" fn baz() { //~ ERROR vectorcall is experimental and subject to change
}
fn main() {
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册