- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
// OK
pub extern "system" fn raw() -> () {}
// warning: `extern` fn uses type `()`, which is not FFI-safe
pub extern "system" fn assoc() -> <() as ToOwned>::Owned {}
//                                ^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
#[repr(transparent)]
pub struct W<T>(T);
// warning: `extern` fn uses type `()`, which is not FFI-safe
pub extern "system" fn wrap() -> W<()> { W(()) }
//                              ^^^^^^ not FFI-safe
// note: composed only of `PhantomData`All of these cases work in Beta. At least the associated type warning is recent regression in Nightly. I suspect #65134
CC @davidtwco
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.