auto merge of #13315 : alexcrichton/rust/libc, r=alexcrichton,me

Rebasing of #12526 with a very obscure bug fixed on windows.
This commit is contained in:
bors 2014-04-06 02:56:39 -07:00
commit f1f50565a1
124 changed files with 612 additions and 511 deletions

View file

@ -12,7 +12,7 @@
// statics cannot. This ensures that there's some form of error if this is
// attempted.
use std::libc;
extern crate libc;
extern {
static mut rust_dbg_static_mut: libc::c_int;

View file

@ -10,7 +10,7 @@
#![deny(ctypes)]
use std::libc;
extern crate libc;
extern {
pub fn bare_type1(size: int); //~ ERROR: found rust type

View file

@ -14,6 +14,8 @@
#![crate_type="lib"]
extern crate libc;
struct Foo; //~ ERROR: code is never used
impl Foo {
fn foo(&self) { //~ ERROR: code is never used
@ -46,7 +48,7 @@ pub fn pub_fn() {
}
mod blah {
use std::libc::size_t;
use libc::size_t;
// not warned because it's used in the parameter of `free` and return of
// `malloc` below, which are also used.
enum c_void {}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::libc;
extern crate libc;
fn main() {
let x : *Vec<int> = &vec!(1,2,3);

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::libc;
extern crate libc;
extern {
static mut a: libc::c_int;

View file

@ -10,7 +10,7 @@
// error-pattern:unsupported cast
use std::libc;
extern crate libc;
fn main() {
println!("{:?}", 1.0 as *libc::FILE); // Can't cast float to foreign.