Skip to content

Commit 38bfd88

Browse files
committed
Add regression test for rust-lang#134060
Mostly just to check that the lint impl doesn't ICE from an easy case.
1 parent 1fcbb1e commit 38bfd88

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/134060> due to impl bug from
2+
//! <https://github.com/rust-lang/rust/pull/131669>. This test should be adjusted in favor of more
3+
//! comprehensive coverage when the changes are to be relanded, as this is a basic sanity check to
4+
//! check that the fuzzed example from #134060 doesn't ICE.
5+
6+
//@ check-pass
7+
8+
#![crate_type = "lib"]
9+
10+
pub trait Foo {
11+
extern "C" fn foo_(&self, _: ()) -> i64 {
12+
//~^ WARN `extern` fn uses type `()`, which is not FFI-safe
13+
0
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
warning: `extern` fn uses type `()`, which is not FFI-safe
2+
--> $DIR/improper_ctypes_definitions_ice_134060.rs:11:34
3+
|
4+
LL | extern "C" fn foo_(&self, _: ()) -> i64 {
5+
| ^^ not FFI-safe
6+
|
7+
= help: consider using a struct instead
8+
= note: tuples have unspecified layout
9+
= note: `#[warn(improper_ctypes_definitions)]` on by default
10+
11+
warning: 1 warning emitted
12+

0 commit comments

Comments
 (0)