Skip to content

Commit d79b258

Browse files
committed
Resolve the lint + extern fn question.
1 parent c67994a commit d79b258

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

active/0000-undefined-struct-layout.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,14 @@ struct CLayout {
142142
// ...
143143
}
144144

145+
145146
extern {
146147
fn foo(x: UnspecifiedLayout); // warning: use of non-FFI-safe struct in extern declaration
147148

148149
fn bar(x: CLayout); // no warning
149150
}
151+
152+
extern "C" fn foo(x: UnspecifiedLayout) { } // warning: use of non-FFI-safe struct in function with C abi.
150153
```
151154

152155

@@ -166,6 +169,3 @@ extern {
166169
end of a struct? (Just always lay-out unsized fields last?
167170
(i.e. after monomorphisation if a field was originally marked
168171
`Sized?` then it needs to be last).)
169-
- Should the lint apply to C-compatible functions defined in Rust like
170-
`extern "C" fn foo(x: UnspecifiedLayout)`? (The equivalent lint for
171-
enums does not pick up this case.)

0 commit comments

Comments
 (0)