Skip to content

Commit

Permalink
Resolve the lint + extern fn question.
Browse files Browse the repository at this point in the history
  • Loading branch information
huonw committed May 20, 2014
1 parent c67994a commit d79b258
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions active/0000-undefined-struct-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,14 @@ struct CLayout {
// ...
}


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

fn bar(x: CLayout); // no warning
}

extern "C" fn foo(x: UnspecifiedLayout) { } // warning: use of non-FFI-safe struct in function with C abi.
```


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

0 comments on commit d79b258

Please sign in to comment.