-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mostly just to check that the lint impl doesn't ICE from an easy case.
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! Regression test for <https://github.com/rust-lang/rust/issues/134060> due to impl bug from | ||
//! <https://github.com/rust-lang/rust/pull/131669>. This test should be adjusted in favor of more | ||
//! comprehensive coverage when the changes are to be relanded, as this is a basic sanity check to | ||
//! check that the fuzzed example from #134060 doesn't ICE. | ||
//@ check-pass | ||
|
||
#![crate_type = "lib"] | ||
|
||
pub trait Foo { | ||
extern "C" fn foo_(&self, _: ()) -> i64 { | ||
//~^ WARN `extern` fn uses type `()`, which is not FFI-safe | ||
0 | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/ui/lint/improper_ctypes_definitions_ice_134060.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
warning: `extern` fn uses type `()`, which is not FFI-safe | ||
--> $DIR/improper_ctypes_definitions_ice_134060.rs:11:34 | ||
| | ||
LL | extern "C" fn foo_(&self, _: ()) -> i64 { | ||
| ^^ not FFI-safe | ||
| | ||
= help: consider using a struct instead | ||
= note: tuples have unspecified layout | ||
= note: `#[warn(improper_ctypes_definitions)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|