Skip to content

Commit

Permalink
Tweak relese notes + rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Apr 2, 2015
1 parent fb77443 commit e3b7e6c
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 24 deletions.
4 changes: 2 additions & 2 deletions RELEASES.md
Expand Up @@ -34,7 +34,7 @@ Version 1.0.0-beta (April 2015)
downcasting via the `Any` trait is effectively limited to
concrete types. This helps retain the potentially-important
"parametricity" property: generic code cannot behave differently
for different type arguments.
for different type arguments except in minor ways.
* The `unsafe_destructor` feature is now deprecated in favor of
the [new `dropck`][dropck]. This change is a major reduction in
unsafe code.
Expand Down Expand Up @@ -78,7 +78,7 @@ Version 1.0.0-beta (April 2015)
[scoped]: http://static.rust-lang.org/doc/master/std/thread/fn.scoped.html
[moar-ufcs]: https://github.com/rust-lang/rust/pull/22172
[prim-inherent]: https://github.com/rust-lang/rust/pull/23104
[overflow]: https://github.com/rust-lang/rust/pull/22532
[overflow]: https://github.com/rust-lang/rfcs/blob/master/text/0560-integer-overflow.md
[metadata-shrink]: https://github.com/rust-lang/rust/pull/22971
[self-sized]: https://github.com/rust-lang/rust/pull/22301
[assoc-where]: https://github.com/rust-lang/rust/pull/22512
Expand Down
45 changes: 34 additions & 11 deletions src/liblibc/lib.rs
Expand Up @@ -291,7 +291,6 @@ pub mod types {
}

pub mod bsd44 {
use core::clone::Clone;
use types::common::c95::{c_void};
use types::os::arch::c95::{c_char, c_int, c_uint};

Expand All @@ -313,7 +312,7 @@ pub mod types {
#[cfg(target_pointer_width = "64")]
pub __ss_pad2: [u8; 128 - 2 * 8],
}
impl Clone for sockaddr_storage {
impl ::core::clone::Clone for sockaddr_storage {
fn clone(&self) -> sockaddr_storage { *self }
}
#[repr(C)]
Expand Down Expand Up @@ -376,7 +375,7 @@ pub mod types {
pub sun_family: sa_family_t,
pub sun_path: [c_char; 108]
}
impl Clone for sockaddr_un {
impl ::core::clone::Clone for sockaddr_un {
fn clone(&self) -> sockaddr_un { *self }
}

Expand Down Expand Up @@ -1634,12 +1633,15 @@ pub mod types {
pub sa_data: [u8; 14],
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_storage {
#[derive(Copy)] pub struct sockaddr_storage {
pub ss_family: sa_family_t,
pub __ss_pad1: [u8; 6],
pub __ss_align: i64,
pub __ss_pad2: [u8; 112],
}
impl ::core::clone::Clone for sockaddr_storage {
fn clone(&self) -> sockaddr_storage { *self }
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_in {
pub sin_family: sa_family_t,
Expand Down Expand Up @@ -1685,10 +1687,13 @@ pub mod types {
pub ai_next: *mut addrinfo,
}
#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_un {
#[derive(Copy)] pub struct sockaddr_un {
pub sun_family: sa_family_t,
pub sun_path: [c_char; 108]
}
impl ::core::clone::Clone for sockaddr_un {
fn clone(&self) -> sockaddr_un { *self }
}
}
}

Expand Down Expand Up @@ -1933,7 +1938,7 @@ pub mod types {
pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;

#[repr(C)]
#[derive(Copy, Clone)] pub struct WSAPROTOCOL_INFO {
#[derive(Copy)] pub struct WSAPROTOCOL_INFO {
pub dwServiceFlags1: DWORD,
pub dwServiceFlags2: DWORD,
pub dwServiceFlags3: DWORD,
Expand All @@ -1955,13 +1960,16 @@ pub mod types {
pub dwProviderReserved: DWORD,
pub szProtocol: [u8; WSAPROTOCOL_LEN as usize + 1],
}
impl ::core::clone::Clone for WSAPROTOCOL_INFO {
fn clone(&self) -> WSAPROTOCOL_INFO { *self }
}

pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;

pub type GROUP = c_uint;

#[repr(C)]
#[derive(Copy, Clone)] pub struct WIN32_FIND_DATAW {
#[derive(Copy)] pub struct WIN32_FIND_DATAW {
pub dwFileAttributes: DWORD,
pub ftCreationTime: FILETIME,
pub ftLastAccessTime: FILETIME,
Expand All @@ -1973,6 +1981,9 @@ pub mod types {
pub cFileName: [wchar_t; 260], // #define MAX_PATH 260
pub cAlternateFileName: [wchar_t; 14],
}
impl ::core::clone::Clone for WIN32_FIND_DATAW {
fn clone(&self) -> WIN32_FIND_DATAW { *self }
}

pub type LPWIN32_FIND_DATAW = *mut WIN32_FIND_DATAW;
}
Expand Down Expand Up @@ -2073,13 +2084,16 @@ pub mod types {
}

#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_storage {
#[derive(Copy)] pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: sa_family_t,
pub __ss_pad1: [u8; 6],
pub __ss_align: i64,
pub __ss_pad2: [u8; 112],
}
impl ::core::clone::Clone for sockaddr_storage {
fn clone(&self) -> sockaddr_storage { *self }
}

#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_in {
Expand Down Expand Up @@ -2135,11 +2149,14 @@ pub mod types {
}

#[repr(C)]
#[derive(Copy, Clone)] pub struct sockaddr_un {
#[derive(Copy)] pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
pub sun_path: [c_char; 104]
}
impl ::core::clone::Clone for sockaddr_un {
fn clone(&self) -> sockaddr_un { *self }
}

#[repr(C)]
#[derive(Copy, Clone)] pub struct ifaddrs {
Expand Down Expand Up @@ -2239,10 +2256,13 @@ pub mod types {
}

#[repr(C)]
#[derive(Copy, Clone)] pub struct pthread_attr_t {
#[derive(Copy)] pub struct pthread_attr_t {
pub __sig: c_long,
pub __opaque: [c_char; 36]
}
impl ::core::clone::Clone for pthread_attr_t {
fn clone(&self) -> pthread_attr_t { *self }
}
}
pub mod posix08 {
}
Expand Down Expand Up @@ -2345,10 +2365,13 @@ pub mod types {
}

#[repr(C)]
#[derive(Copy, Clone)] pub struct pthread_attr_t {
#[derive(Copy)] pub struct pthread_attr_t {
pub __sig: c_long,
pub __opaque: [c_char; 56]
}
impl ::core::clone::Clone for pthread_attr_t {
fn clone(&self) -> pthread_attr_t { *self }
}
}
pub mod posix08 {
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/traits/coherence.rs
Expand Up @@ -25,7 +25,7 @@ use syntax::ast;
use syntax::codemap::{DUMMY_SP, Span};
use util::ppaux::Repr;

#[derive(Copy)]
#[derive(Copy, Clone)]
struct ParamIsLocal(bool);

/// True if there exist types that satisfy both of the two given impls.
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/rt/unwind.rs
Expand Up @@ -398,7 +398,7 @@ pub mod eabi {
pub struct DISPATCHER_CONTEXT;

#[repr(C)]
#[derive(Copy)]
#[derive(Copy, Clone)]
pub enum EXCEPTION_DISPOSITION {
ExceptionContinueExecution,
ExceptionContinueSearch,
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/common/net.rs
Expand Up @@ -115,9 +115,9 @@ pub fn socket(addr: SocketAddr, ty: libc::c_int) -> IoResult<sock_t> {
Ipv4Addr(..) => libc::AF_INET,
Ipv6Addr(..) => libc::AF_INET6,
};
match libc::socket(fam, ty, 0) {
match libc::socket(fam, ty, 0) as i32 {
-1 => Err(last_net_error()),
fd => Ok(fd),
fd => Ok(fd as sock_t),
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/libstd/sys/windows/c.rs
Expand Up @@ -89,7 +89,6 @@ pub type LPWSANETWORKEVENTS = *mut WSANETWORKEVENTS;
pub type WSAEVENT = libc::HANDLE;

#[repr(C)]
#[derive(Copy)]
pub struct WSAPROTOCOL_INFO {
pub dwServiceFlags1: libc::DWORD,
pub dwServiceFlags2: libc::DWORD,
Expand Down
5 changes: 3 additions & 2 deletions src/libstd/sys/windows/tcp.rs
Expand Up @@ -15,6 +15,7 @@ use prelude::v1::*;
use old_io::net::ip;
use old_io::IoResult;
use libc;
use libc::consts::os::extra::INVALID_SOCKET;
use mem;
use ptr;
use super::{last_error, last_net_error, sock_t};
Expand Down Expand Up @@ -183,8 +184,8 @@ impl TcpAcceptor {
match unsafe {
libc::accept(self.socket(), ptr::null_mut(), ptr::null_mut())
} {
-1 if wouldblock() => {}
-1 => return Err(last_net_error()),
INVALID_SOCKET if wouldblock() => {}
INVALID_SOCKET => return Err(last_net_error()),

// Accepted sockets inherit the same properties as the caller,
// so we need to deregister our event and switch the socket back
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/diagnostic.rs
Expand Up @@ -371,7 +371,7 @@ fn stderr_isatty() -> bool {
}
#[cfg(windows)]
fn stderr_isatty() -> bool {
const STD_ERROR_HANDLE: libc::DWORD = -12;
const STD_ERROR_HANDLE: libc::DWORD = -12i32 as libc::DWORD;
extern "system" {
fn GetStdHandle(which: libc::DWORD) -> libc::HANDLE;
fn GetConsoleMode(hConsoleHandle: libc::HANDLE,
Expand Down
5 changes: 3 additions & 2 deletions src/libterm/win.rs
Expand Up @@ -104,7 +104,7 @@ impl<T: Write+Send+'static> WinConsole<T> {
// terminal! Admittedly, this is fragile, since stderr could be
// redirected to a different console. This is good enough for
// rustc though. See #13400.
let out = GetStdHandle(-11);
let out = GetStdHandle(-11i32 as libc::DWORD);
SetConsoleTextAttribute(out, accum);
}
}
Expand All @@ -116,7 +116,8 @@ impl<T: Write+Send+'static> WinConsole<T> {
let bg;
unsafe {
let mut buffer_info = ::std::mem::uninitialized();
if GetConsoleScreenBufferInfo(GetStdHandle(-11), &mut buffer_info) != 0 {
if GetConsoleScreenBufferInfo(GetStdHandle(-11i32 as libc::DWORD),
&mut buffer_info) != 0 {
fg = bits_to_color(buffer_info.wAttributes);
bg = bits_to_color(buffer_info.wAttributes >> 4);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/libtest/lib.rs
Expand Up @@ -757,7 +757,7 @@ fn stdout_isatty() -> bool {
}
#[cfg(windows)]
fn stdout_isatty() -> bool {
const STD_OUTPUT_HANDLE: libc::DWORD = -11;
const STD_OUTPUT_HANDLE: libc::DWORD = -11i32 as libc::DWORD;
extern "system" {
fn GetStdHandle(which: libc::DWORD) -> libc::HANDLE;
fn GetConsoleMode(hConsoleHandle: libc::HANDLE,
Expand Down
2 changes: 2 additions & 0 deletions src/test/compile-fail/coherence-impls-copy.rs
Expand Up @@ -28,6 +28,8 @@ impl Copy for MyType {}

impl Copy for &'static mut MyType {}
//~^ ERROR E0206
//~| ERROR E0277
//~| ERROR E0277
impl Clone for MyType { fn clone(&self) -> Self { *self } }

impl Copy for (MyType, MyType) {}
Expand Down

0 comments on commit e3b7e6c

Please sign in to comment.