Skip to content

Commit bc5afd9

Browse files
committed
Ensure ffi_unwind_calls lint is gated behind c_unwind
1 parent 77fd0cc commit bc5afd9

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

src/test/ui/unwind-abis/feature-gate-c-unwind.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Test that the "C-unwind" ABI is feature-gated, and cannot be used when the
22
// `c_unwind` feature gate is not used.
33

4+
#![allow(ffi_unwind_calls)]
5+
//~^ WARNING unknown lint: `ffi_unwind_calls`
6+
//~| WARNING unknown lint: `ffi_unwind_calls`
7+
48
extern "C-unwind" fn f() {}
59
//~^ ERROR C-unwind ABI is experimental and subject to change [E0658]
610

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
1+
warning: unknown lint: `ffi_unwind_calls`
2+
--> $DIR/feature-gate-c-unwind.rs:4:1
3+
|
4+
LL | #![allow(ffi_unwind_calls)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: `#[warn(unknown_lints)]` on by default
8+
= note: the `ffi_unwind_calls` lint is unstable
9+
= note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
10+
= help: add `#![feature(c_unwind)]` to the crate attributes to enable
11+
112
error[E0658]: C-unwind ABI is experimental and subject to change
2-
--> $DIR/feature-gate-c-unwind.rs:4:8
13+
--> $DIR/feature-gate-c-unwind.rs:8:8
314
|
415
LL | extern "C-unwind" fn f() {}
516
| ^^^^^^^^^^
617
|
718
= note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
819
= help: add `#![feature(c_unwind)]` to the crate attributes to enable
920

10-
error: aborting due to previous error
21+
warning: unknown lint: `ffi_unwind_calls`
22+
--> $DIR/feature-gate-c-unwind.rs:4:1
23+
|
24+
LL | #![allow(ffi_unwind_calls)]
25+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
26+
|
27+
= note: the `ffi_unwind_calls` lint is unstable
28+
= note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
29+
= help: add `#![feature(c_unwind)]` to the crate attributes to enable
30+
31+
error: aborting due to previous error; 2 warnings emitted
1132

1233
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)