]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #66305 - elichai:2019-11-array_ffi, r=eddyb
authorTyler Mandry <tmandry@gmail.com>
Wed, 27 Nov 2019 21:28:33 +0000 (15:28 -0600)
committerGitHub <noreply@github.com>
Wed, 27 Nov 2019 21:28:33 +0000 (15:28 -0600)
Add by-value arrays to `improper_ctypes` lint

Hi,
C doesn't have a notion of passing arrays by value, only by reference/pointer.
Rust currently will pass it correctly by reference by it looks very misleading, and can confuse the borrow checker to think a move had occurred.

Fixes #58905 and fixes #24578.

We could also improve the borrow checker here but I think it's kinda a waste of work if we instead just tell the user it's an invalid FFI call.

(My first PR to `rustc` so if I missed some test or formatting guideline please tell me :) )

1  2 
src/librustc_lint/types.rs

Simple merge