mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 22:46:50 +00:00
add unwind_asm
feature gate for may_unwind
option
This commit is contained in:
parent
059d3b3f34
commit
686ace3b41
@ -49,6 +49,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
.struct_span_err(sp, "the `att_syntax` option is only supported on x86")
|
||||
.emit();
|
||||
}
|
||||
if asm.options.contains(InlineAsmOptions::MAY_UNWIND)
|
||||
&& !self.sess.features_untracked().asm_unwind
|
||||
{
|
||||
feature_err(
|
||||
&self.sess.parse_sess,
|
||||
sym::asm_unwind,
|
||||
sp,
|
||||
"the `may_unwind` option is unstable",
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
|
||||
let mut clobber_abis = FxHashMap::default();
|
||||
if let Some(asm_arch) = asm_arch {
|
||||
|
@ -290,6 +290,8 @@ declare_features! (
|
||||
(active, asm_experimental_arch, "1.58.0", Some(72016), None),
|
||||
/// Allows using `sym` operands in inline assembly.
|
||||
(active, asm_sym, "1.58.0", Some(72016), None),
|
||||
/// Allows the `may_unwind` option in inline assembly.
|
||||
(active, asm_unwind, "1.58.0", Some(72016), None),
|
||||
/// Allows the user of associated type bounds.
|
||||
(active, associated_type_bounds, "1.34.0", Some(52662), None),
|
||||
/// Allows associated type defaults.
|
||||
|
@ -332,6 +332,7 @@ symbols! {
|
||||
asm_const,
|
||||
asm_experimental_arch,
|
||||
asm_sym,
|
||||
asm_unwind,
|
||||
assert,
|
||||
assert_inhabited,
|
||||
assert_macro,
|
||||
|
8
src/test/ui/feature-gates/feature-gate-asm_unwind.rs
Normal file
8
src/test/ui/feature-gates/feature-gate-asm_unwind.rs
Normal file
@ -0,0 +1,8 @@
|
||||
#![feature(asm)]
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
asm!("", options(may_unwind));
|
||||
//~^ ERROR the `may_unwind` option is unstable
|
||||
}
|
||||
}
|
12
src/test/ui/feature-gates/feature-gate-asm_unwind.stderr
Normal file
12
src/test/ui/feature-gates/feature-gate-asm_unwind.stderr
Normal file
@ -0,0 +1,12 @@
|
||||
error[E0658]: the `may_unwind` option is unstable
|
||||
--> $DIR/feature-gate-asm_unwind.rs:5:9
|
||||
|
|
||||
LL | asm!("", options(may_unwind));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #72016 <https://github.com/rust-lang/rust/issues/72016> for more information
|
||||
= help: add `#![feature(asm_unwind)]` to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
Loading…
Reference in New Issue
Block a user