Skip to content

Commit f0f56e5

Browse files
committed
---
yaml --- r: 127422 b: refs/heads/auto c: 0f5ce0f h: refs/heads/master v: v3
1 parent 5cbd634 commit f0f56e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+329
-1275
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 4ed40ffe8ebbb4479f48af59781d9cf7dcc359da
16+
refs/heads/auto: 0f5ce0f0df106bde3b65a97079ebf8cd9e47bc20
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ please do two things:
1616

1717
2. Run the full Rust test suite with the `make check` command. You're
1818
not off the hook even if you just stick to documentation; code
19-
examples in the docs are tested as well! Although for simple
20-
wording or grammar fixes, this is probably unnecessary.
19+
examples in the docs are tested as well!
2120

2221
Pull requests will be treated as "review requests", and we will give
2322
feedback we expect to see corrected on

branches/auto/mk/main.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ endif
139139
RUSTFLAGS_STAGE0 += -C prefer-dynamic
140140
RUSTFLAGS_STAGE1 += -C prefer-dynamic
141141

142-
# Landing pads require a lot of codegen. We can get through bootstrapping faster
143-
# by not emitting them.
144-
RUSTFLAGS_STAGE0 += -Z no-landing-pads
145-
146142
# platform-specific auto-configuration
147143
include $(CFG_SRC_DIR)mk/platform.mk
148144

branches/auto/src/doc/guide.md

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,86 +1432,6 @@ building our guessing game, but we need to know how to do one last thing first:
14321432
get input from the keyboard. You can't have a guessing game without the ability
14331433
to guess!
14341434

1435-
# Strings
1436-
1437-
Strings are an important concept for any programmer to master. Rust's string
1438-
handling system is a bit different than in other languages, due to its systems
1439-
focus. Any time you have a data structure of variable size, things can get
1440-
tricky, and strings are a re-sizable data structure. That said, Rust's strings
1441-
also work differently than in some other systems languages, such as C.
1442-
1443-
Let's dig into the details. A **string** is a sequence of unicode scalar values
1444-
encoded as a stream of UTF-8 bytes. All strings are guaranteed to be
1445-
validly-encoded UTF-8 sequences. Additionally, strings are not null-terminated
1446-
and can contain null bytes.
1447-
1448-
Rust has two main types of strings: `&str` and `String`.
1449-
1450-
The first kind is a `&str`. This is pronounced a 'string slice.' String literals
1451-
are of the type `&str`:
1452-
1453-
```{rust}
1454-
let string = "Hello there.";
1455-
```
1456-
1457-
This string is statically allocated, meaning that it's saved inside our
1458-
compiled program, and exists for the entire duration it runs. The `string`
1459-
binding is a reference to this statically allocated string. String slices
1460-
have a fixed size, and cannot be mutated.
1461-
1462-
A `String`, on the other hand, is an in-memory string. This string is
1463-
growable, and is also guaranteed to be UTF-8.
1464-
1465-
```{rust}
1466-
let mut s = "Hello".to_string();
1467-
println!("{}", s);
1468-
1469-
s.push_str(", world.");
1470-
println!("{}", s);
1471-
```
1472-
1473-
You can coerce a `String` into a `&str` with the `as_slice()` method:
1474-
1475-
```{rust}
1476-
fn takes_slice(slice: &str) {
1477-
println!("Got: {}", slice);
1478-
}
1479-
1480-
fn main() {
1481-
let s = "Hello".to_string();
1482-
takes_slice(s.as_slice());
1483-
}
1484-
```
1485-
1486-
To compare a String to a constant string, prefer `as_slice()`...
1487-
1488-
```{rust}
1489-
fn compare(string: String) {
1490-
if string.as_slice() == "Hello" {
1491-
println!("yes");
1492-
}
1493-
}
1494-
```
1495-
1496-
... over `to_string()`:
1497-
1498-
```{rust}
1499-
fn compare(string: String) {
1500-
if string == "Hello".to_string() {
1501-
println!("yes");
1502-
}
1503-
}
1504-
```
1505-
1506-
Converting a `String` to a `&str` is cheap, but converting the `&str` to a
1507-
`String` involves allocating memory. No reason to do that unless you have to!
1508-
1509-
That's the basics of strings in Rust! They're probably a bit more complicated
1510-
than you are used to, if you come from a scripting language, but when the
1511-
low-level details matter, they really matter. Just remember that `String`s
1512-
allocate memory and control their data, while `&str`s are a reference to
1513-
another string, and you'll be all set.
1514-
15151435
# Standard Input
15161436

15171437
Getting input from the keyboard is pretty easy, but uses some things

branches/auto/src/libcollections/ringbuf.rs

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,11 @@ impl<'a, T> ExactSize<&'a mut T> for MutItems<'a, T> {}
403403
fn grow<T>(nelts: uint, loptr: &mut uint, elts: &mut Vec<Option<T>>) {
404404
assert_eq!(nelts, elts.len());
405405
let lo = *loptr;
406-
elts.reserve(nelts * 2);
407-
let newlen = elts.capacity();
406+
let newlen = nelts * 2;
407+
elts.reserve(newlen);
408408

409409
/* fill with None */
410-
for _ in range(elts.len(), newlen) {
410+
for _ in range(elts.len(), elts.capacity()) {
411411
elts.push(None);
412412
}
413413

@@ -750,47 +750,6 @@ mod tests {
750750
assert_eq!(d.len(), 1);
751751
}
752752

753-
#[test]
754-
fn test_with_capacity_non_power_two() {
755-
let mut d3 = RingBuf::with_capacity(3);
756-
d3.push(1i);
757-
758-
// X = None, | = lo
759-
// [|1, X, X]
760-
assert_eq!(d3.pop_front(), Some(1));
761-
// [X, |X, X]
762-
assert_eq!(d3.front(), None);
763-
764-
// [X, |3, X]
765-
d3.push(3);
766-
// [X, |3, 6]
767-
d3.push(6);
768-
// [X, X, |6]
769-
assert_eq!(d3.pop_front(), Some(3));
770-
771-
// Pushing the lo past half way point to trigger
772-
// the 'B' scenario for growth
773-
// [9, X, |6]
774-
d3.push(9);
775-
// [9, 12, |6]
776-
d3.push(12);
777-
778-
d3.push(15);
779-
// There used to be a bug here about how the
780-
// RingBuf made growth assumptions about the
781-
// underlying Vec which didn't hold and lead
782-
// to corruption.
783-
// (Vec grows to next power of two)
784-
//good- [9, 12, 15, X, X, X, X, |6]
785-
//bug- [15, 12, X, X, X, |6, X, X]
786-
assert_eq!(d3.pop_front(), Some(6));
787-
788-
// Which leads us to the following state which
789-
// would be a failure case.
790-
//bug- [15, 12, X, X, X, X, |X, X]
791-
assert_eq!(d3.front(), Some(&9));
792-
}
793-
794753
#[test]
795754
fn test_reserve_exact() {
796755
let mut d = RingBuf::new();

branches/auto/src/libcore/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ impl Float for f32 {
293293
#[inline]
294294
fn frac_pi_8() -> f32 { consts::FRAC_PI_8 }
295295

296-
/// 1.0 / pi
296+
/// 1 .0/ pi
297297
#[inline]
298298
fn frac_1_pi() -> f32 { consts::FRAC_1_PI }
299299

branches/auto/src/liblibc/lib.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,16 +1142,18 @@ pub mod types {
11421142
pub mod os {
11431143
pub mod common {
11441144
pub mod posix01 {
1145-
use types::os::arch::c95::{c_short, time_t, c_long};
1145+
use types::os::arch::c95::{c_short, time_t, suseconds_t,
1146+
c_long};
11461147
use types::os::arch::extra::{int64, time64_t};
11471148
use types::os::arch::posix88::{dev_t, ino_t};
1149+
use types::os::arch::posix88::mode_t;
11481150

11491151
// pub Note: this is the struct called stat64 in win32. Not stat,
11501152
// nor stati64.
11511153
pub struct stat {
11521154
pub st_dev: dev_t,
11531155
pub st_ino: ino_t,
1154-
pub st_mode: u16,
1156+
pub st_mode: mode_t,
11551157
pub st_nlink: c_short,
11561158
pub st_uid: c_short,
11571159
pub st_gid: c_short,
@@ -1169,8 +1171,8 @@ pub mod types {
11691171
}
11701172

11711173
pub struct timeval {
1172-
pub tv_sec: c_long,
1173-
pub tv_usec: c_long,
1174+
pub tv_sec: time_t,
1175+
pub tv_usec: suseconds_t,
11741176
}
11751177

11761178
pub struct timespec {
@@ -1184,7 +1186,7 @@ pub mod types {
11841186
pub mod bsd44 {
11851187
use types::os::arch::c95::{c_char, c_int, c_uint, size_t};
11861188

1187-
pub type SOCKET = uint;
1189+
pub type SOCKET = c_uint;
11881190
pub type socklen_t = c_int;
11891191
pub type sa_family_t = u16;
11901192
pub type in_port_t = u16;
@@ -1195,7 +1197,6 @@ pub mod types {
11951197
}
11961198
pub struct sockaddr_storage {
11971199
pub ss_family: sa_family_t,
1198-
pub __ss_pad1: [u8, ..6],
11991200
pub __ss_align: i64,
12001201
pub __ss_pad2: [u8, ..112],
12011202
}
@@ -1292,9 +1293,12 @@ pub mod types {
12921293
pub mod posix88 {
12931294
pub type off_t = i32;
12941295
pub type dev_t = u32;
1295-
pub type ino_t = u16;
1296+
pub type ino_t = i16;
12961297

1297-
pub type pid_t = u32;
1298+
#[cfg(target_arch = "x86")]
1299+
pub type pid_t = i32;
1300+
#[cfg(target_arch = "x86_64")]
1301+
pub type pid_t = i64;
12981302

12991303
pub type useconds_t = u32;
13001304
pub type mode_t = u16;
@@ -1411,7 +1415,7 @@ pub mod types {
14111415
pub dwPageSize: DWORD,
14121416
pub lpMinimumApplicationAddress: LPVOID,
14131417
pub lpMaximumApplicationAddress: LPVOID,
1414-
pub dwActiveProcessorMask: uint,
1418+
pub dwActiveProcessorMask: DWORD,
14151419
pub dwNumberOfProcessors: DWORD,
14161420
pub dwProcessorType: DWORD,
14171421
pub dwAllocationGranularity: DWORD,
@@ -1946,7 +1950,7 @@ pub mod consts {
19461950
}
19471951
pub mod extra {
19481952
use types::os::arch::c95::c_int;
1949-
use types::os::arch::extra::{WORD, DWORD, BOOL, HANDLE};
1953+
use types::os::arch::extra::{WORD, DWORD, BOOL};
19501954

19511955
pub static TRUE : BOOL = 1;
19521956
pub static FALSE : BOOL = 0;
@@ -1975,7 +1979,7 @@ pub mod consts {
19751979
pub static ERROR_IO_PENDING: c_int = 997;
19761980
pub static ERROR_FILE_INVALID : c_int = 1006;
19771981
pub static ERROR_NOT_FOUND: c_int = 1168;
1978-
pub static INVALID_HANDLE_VALUE: HANDLE = -1 as HANDLE;
1982+
pub static INVALID_HANDLE_VALUE : c_int = -1;
19791983

19801984
pub static DELETE : DWORD = 0x00010000;
19811985
pub static READ_CONTROL : DWORD = 0x00020000;

branches/auto/src/libnative/io/c_win32.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub static ENABLE_PROCESSED_INPUT: libc::DWORD = 0x1;
2828
pub static ENABLE_QUICK_EDIT_MODE: libc::DWORD = 0x40;
2929

3030
#[repr(C)]
31-
#[cfg(target_arch = "x86")]
3231
pub struct WSADATA {
3332
pub wVersion: libc::WORD,
3433
pub wHighVersion: libc::WORD,
@@ -38,17 +37,6 @@ pub struct WSADATA {
3837
pub iMaxUdpDg: u16,
3938
pub lpVendorInfo: *mut u8,
4039
}
41-
#[repr(C)]
42-
#[cfg(target_arch = "x86_64")]
43-
pub struct WSADATA {
44-
pub wVersion: libc::WORD,
45-
pub wHighVersion: libc::WORD,
46-
pub iMaxSockets: u16,
47-
pub iMaxUdpDg: u16,
48-
pub lpVendorInfo: *mut u8,
49-
pub szDescription: [u8, ..WSADESCRIPTION_LEN + 1],
50-
pub szSystemStatus: [u8, ..WSASYS_STATUS_LEN + 1],
51-
}
5240

5341
pub type LPWSADATA = *mut WSADATA;
5442

branches/auto/src/libnative/io/file_win32.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub fn open(path: &CString, fm: rtio::FileMode, fa: rtio::FileAccess)
320320
dwFlagsAndAttributes,
321321
ptr::mut_null())
322322
};
323-
if handle == libc::INVALID_HANDLE_VALUE {
323+
if handle == libc::INVALID_HANDLE_VALUE as libc::HANDLE {
324324
Err(super::last_error())
325325
} else {
326326
let fd = unsafe {
@@ -368,7 +368,7 @@ pub fn readdir(p: &CString) -> IoResult<Vec<CString>> {
368368
let wfd_ptr = malloc_raw(rust_list_dir_wfd_size() as uint);
369369
let find_handle = libc::FindFirstFileW(path.as_ptr(),
370370
wfd_ptr as libc::HANDLE);
371-
if find_handle != libc::INVALID_HANDLE_VALUE {
371+
if find_handle as libc::c_int != libc::INVALID_HANDLE_VALUE {
372372
let mut paths = vec!();
373373
let mut more_files = 1 as libc::c_int;
374374
while more_files != 0 {
@@ -440,7 +440,7 @@ pub fn readlink(p: &CString) -> IoResult<CString> {
440440
libc::FILE_ATTRIBUTE_NORMAL,
441441
ptr::mut_null())
442442
};
443-
if handle == libc::INVALID_HANDLE_VALUE {
443+
if handle as int == libc::INVALID_HANDLE_VALUE as int {
444444
return Err(super::last_error())
445445
}
446446
// Specify (sz - 1) because the documentation states that it's the size

branches/auto/src/libnative/io/pipe_win32.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ impl UnixStream {
223223
libc::FILE_FLAG_OVERLAPPED,
224224
ptr::mut_null())
225225
};
226-
if result != libc::INVALID_HANDLE_VALUE {
226+
if result != libc::INVALID_HANDLE_VALUE as libc::HANDLE {
227227
return Some(result)
228228
}
229229

@@ -238,7 +238,7 @@ impl UnixStream {
238238
libc::FILE_FLAG_OVERLAPPED,
239239
ptr::mut_null())
240240
};
241-
if result != libc::INVALID_HANDLE_VALUE {
241+
if result != libc::INVALID_HANDLE_VALUE as libc::HANDLE {
242242
return Some(result)
243243
}
244244
}
@@ -253,7 +253,7 @@ impl UnixStream {
253253
libc::FILE_FLAG_OVERLAPPED,
254254
ptr::mut_null())
255255
};
256-
if result != libc::INVALID_HANDLE_VALUE {
256+
if result != libc::INVALID_HANDLE_VALUE as libc::HANDLE {
257257
return Some(result)
258258
}
259259
}
@@ -565,7 +565,7 @@ impl UnixListener {
565565
// and such.
566566
let addr_v = try!(to_utf16(addr));
567567
let ret = unsafe { pipe(addr_v.as_ptr(), true) };
568-
if ret == libc::INVALID_HANDLE_VALUE {
568+
if ret == libc::INVALID_HANDLE_VALUE as libc::HANDLE {
569569
Err(super::last_error())
570570
} else {
571571
Ok(UnixListener { handle: ret, name: addr.clone() })
@@ -680,7 +680,7 @@ impl UnixAcceptor {
680680
// create a second server pipe. If this fails, we disconnect the
681681
// connected client and return an error (see comments above).
682682
let new_handle = unsafe { pipe(name.as_ptr(), false) };
683-
if new_handle == libc::INVALID_HANDLE_VALUE {
683+
if new_handle == libc::INVALID_HANDLE_VALUE as libc::HANDLE {
684684
let ret = Err(super::last_error());
685685
// If our disconnection fails, then there's not really a whole lot
686686
// that we can do, so fail the task.

0 commit comments

Comments
 (0)