Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert #131669 due to ICEs #134064

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add regression test for #134060
Mostly just to check that the lint impl doesn't ICE from an easy case.
  • Loading branch information
jieyouxu committed Dec 9, 2024
commit 38bfd88db788210d2481e3c74b2c63006f658cc8
15 changes: 15 additions & 0 deletions tests/ui/lint/improper_ctypes_definitions_ice_134060.rs
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 tests/ui/lint/improper_ctypes_definitions_ice_134060.stderr
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

Loading