Skip to content

Commit 455f7a1

Browse files
committed
---
yaml --- r: 50391 b: refs/heads/auto c: 85ed840 h: refs/heads/master i: 50389: 7380721 50387: 57b4dca 50383: cc6451b v: v3
1 parent 823fb98 commit 455f7a1

File tree

139 files changed

+457
-374
lines changed

Some content is hidden

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

139 files changed

+457
-374
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 0a5e522acd7d3e95efa15315ddb6ad4853cdd2a9
17+
refs/heads/auto: 85ed840e234184b7975d9ee7b022c0ca2cb5d8ff
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167

branches/auto/configure

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -881,10 +881,6 @@ do
881881
;;
882882
esac
883883
need_ok "LLVM configure failed"
884-
885-
# Hack the tools Makefile to turn off the clang build
886-
sed -i 's/clang//g' tools/Makefile
887-
888884
cd $CFG_BUILD_DIR
889885
fi
890886

branches/auto/doc/rust.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ but a small number are defined in terms of Unicode properties or explicit codepo
125125
## Special Unicode Productions
126126

127127
The following productions in the Rust grammar are defined in terms of Unicode properties:
128-
`ident`, `non_null`, `non_star`, `non_eol`, `non_slash_or_star`, `non_single_quote` and `non_double_quote`.
128+
`ident`, `non_null`, `non_star`, `non_eol`, `non_slash`, `non_single_quote` and `non_double_quote`.
129129

130130
### Identifiers
131131

@@ -147,16 +147,16 @@ Some productions are defined by exclusion of particular Unicode characters:
147147
- `non_null` is any single Unicode character aside from `U+0000` (null)
148148
- `non_eol` is `non_null` restricted to exclude `U+000A` (`'\n'`)
149149
- `non_star` is `non_null` restricted to exclude `U+002A` (`*`)
150-
- `non_slash_or_star` is `non_null` restricted to exclude `U+002F` (`/`) and `U+002A` (`*`)
150+
- `non_slash` is `non_null` restricted to exclude `U+002F` (`/`)
151151
- `non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`)
152152
- `non_double_quote` is `non_null` restricted to exclude `U+0022` (`"`)
153153

154154
## Comments
155155

156156
~~~~~~~~ {.ebnf .gram}
157157
comment : block_comment | line_comment ;
158-
block_comment : "/*" block_comment_body * '*' + '/' ;
159-
block_comment_body : non_star * | '*' + non_slash_or_star ;
158+
block_comment : "/*" block_comment_body * "*/" ;
159+
block_comment_body : non_star * | '*' non_slash ;
160160
line_comment : "//" non_eol * ;
161161
~~~~~~~~
162162

branches/auto/doc/tutorial-tasks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ spawns the child task.
188188

189189
~~~~
190190
# use core::task::spawn;
191-
# use core::comm::stream;
191+
# use core::comm::{stream, Port, Chan};
192192
# fn some_expensive_computation() -> int { 42 }
193193
# let (port, chan) = stream();
194194
do spawn || {
@@ -208,7 +208,7 @@ computation, then waits for the child's result to arrive on the
208208
port:
209209

210210
~~~~
211-
# use core::comm::{stream};
211+
# use core::comm::{stream, Port, Chan};
212212
# fn some_other_expensive_computation() {}
213213
# let (port, chan) = stream::<int>();
214214
# chan.send(0);
@@ -277,7 +277,7 @@ might look like the example below.
277277

278278
~~~
279279
# use core::task::spawn;
280-
# use core::comm::stream;
280+
# use core::comm::{stream, Port, Chan};
281281
282282
// Create a vector of ports, one for each child task
283283
let ports = do vec::from_fn(3) |init_val| {

branches/auto/doc/tutorial.md

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,11 +1002,46 @@ refer to that through a pointer.
10021002

10031003
## Owned boxes
10041004

1005-
An owned box (`~`) is a uniquely owned allocation on the heap. An owned box
1006-
inherits the mutability and lifetime of the owner as it would if there was no
1007-
box. The purpose of an owned box is to add a layer of indirection in order to
1008-
create recursive data structures or cheaply pass around an object larger than a
1009-
pointer.
1005+
An owned box (`~`) is a uniquely owned allocation on the heap. It inherits the
1006+
mutability and lifetime of the owner as it would if there was no box.
1007+
1008+
~~~~
1009+
let x = 5; // immutable
1010+
let mut y = 5; // mutable
1011+
y += 2;
1012+
1013+
let x = ~5; // immutable
1014+
let mut y = ~5; // mutable
1015+
*y += 2; // the * operator is needed to access the contained value
1016+
~~~~
1017+
1018+
The purpose of an owned box is to add a layer of indirection in order to create
1019+
recursive data structures or cheaply pass around an object larger than a
1020+
pointer. Since an owned box has a unique owner, it can be used to represent any
1021+
tree data structure.
1022+
1023+
The following struct won't compile, because the lack of indirection would mean
1024+
it has an infinite size:
1025+
1026+
~~~~ {.xfail-test}
1027+
struct Foo {
1028+
child: Option<Foo>
1029+
}
1030+
~~~~
1031+
1032+
> ***Note:*** The `Option` type is an enum that represents an *optional* value.
1033+
> It's comparable to a nullable pointer in many other languages, but stores the
1034+
> contained value unboxed.
1035+
1036+
Adding indirection with an owned pointer allocates the child outside of the
1037+
struct on the heap, which makes it a finite size and won't result in a
1038+
compile-time error:
1039+
1040+
~~~~
1041+
struct Foo {
1042+
child: Option<~Foo>
1043+
}
1044+
~~~~
10101045

10111046
## Managed boxes
10121047

@@ -1035,10 +1070,10 @@ let z = x; // no new memory allocated, x can no longer be used
10351070
# Borrowed pointers
10361071

10371072
Rust's borrowed pointers are a general purpose reference type. In contrast with
1038-
owned pointers, where the holder of an owned pointer is the owner of the
1039-
pointed-to memory, borrowed pointers never imply ownership. A pointer can be
1040-
borrowed to any object, and the compiler verifies that it cannot outlive the
1041-
lifetime of the object.
1073+
owned boxes, where the holder of an owned box is the owner of the pointed-to
1074+
memory, borrowed pointers never imply ownership. A pointer can be borrowed to
1075+
any object, and the compiler verifies that it cannot outlive the lifetime of
1076+
the object.
10421077

10431078
As an example, consider a simple struct type, `Point`:
10441079

branches/auto/src/compiletest/procsrv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use core::prelude::*;
1212

1313
use core::io::{ReaderUtil, WriterUtil};
1414
use core::io;
15-
use core::libc::c_int;
15+
use core::libc::{c_int, pid_t};
1616
use core::os;
1717
use core::run::spawn_process;
1818
use core::run;

branches/auto/src/libcore/cleanup.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
#[doc(hidden)];
1212

1313
use libc::{c_char, c_void, intptr_t, uintptr_t};
14-
use ptr::mut_null;
14+
use ptr::{mut_null, null, to_unsafe_ptr};
1515
use repr::BoxRepr;
1616
use sys::TypeDesc;
1717
use cast::transmute;
1818

19-
#[cfg(notest)] use ptr::to_unsafe_ptr;
20-
2119
/**
2220
* Runtime structures
2321
*

branches/auto/src/libcore/comm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ pub fn try_send_one<T: Owned>(chan: ChanOne<T>, data: T)
429429
430430
#[cfg(test)]
431431
pub mod test {
432-
use either::Right;
432+
use either::{Either, Left, Right};
433433
use super::{Chan, Port, oneshot, recv_one, stream};
434434
435435
#[test]

branches/auto/src/libcore/gc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ with destructors.
3838
*/
3939

4040
use cast;
41-
use container::{Map, Set};
41+
use container::{Container, Mutable, Map, Set};
4242
use io;
4343
use libc::{size_t, uintptr_t};
4444
use option::{None, Option, Some};

branches/auto/src/libcore/hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121

2222
use io;
23-
use io::Writer;
23+
use io::{Writer, WriterUtil};
2424
use to_bytes::IterBytes;
2525
use uint;
2626
use vec;

branches/auto/src/libcore/hashmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ pub mod linear {
667667

668668
#[test]
669669
mod test_map {
670-
use container::{Container, Map, Set};
670+
use container::{Container, Mutable, Map, Set};
671671
use option::{None, Some};
672672
use hashmap::linear::LinearMap;
673673
use hashmap::linear;
@@ -845,7 +845,7 @@ pub mod linear {
845845
#[test]
846846
mod test_set {
847847
use hashmap::linear;
848-
use container::{Container, Map, Set};
848+
use container::{Container, Mutable, Map, Set};
849849
use vec;
850850

851851
#[test]

branches/auto/src/libcore/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use result::Result;
1818

1919
use int;
2020
use libc;
21-
use libc::{c_int, c_long, c_void, size_t, ssize_t};
21+
use libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
2222
use libc::consts::os::posix88::*;
2323
use os;
2424
use cast;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ use f64;
2424
use num::NumCast;
2525
use num::strconv;
2626
use num;
27-
use option::Option;
27+
use option::{None, Option, Some};
2828
use to_str;
2929
use from_str;
3030

3131
#[cfg(notest)] use cmp::{Eq, Ord};
3232
#[cfg(notest)] use ops;
33-
#[cfg(test)] use option::{Some, None};
3433

3534
pub use f64::{add, sub, mul, div, rem, lt, le, eq, ne, ge, gt};
3635
pub use f64::logarithm;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// except according to those terms.
1010

1111
//! An interface for numeric types
12-
use cmp::Ord;
13-
use ops::{Div, Mul, Neg};
14-
use option::Option;
12+
use cmp::{Ord, Eq};
13+
use ops::{Add, Div, Modulo, Mul, Neg, Sub};
14+
use option::{None, Option, Some};
1515
use kinds::Copy;
1616

1717
pub mod strconv;

branches/auto/src/libcore/num/uint-template.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use from_str::FromStr;
1616
use num::{ToStrRadix, FromStrRadix};
1717
use num::strconv;
1818
use num;
19-
use option::Option;
19+
use option::{None, Option, Some};
2020
use prelude::*;
2121

2222
#[cfg(notest)] use cmp::{Eq, Ord};

branches/auto/src/libcore/os.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
use cast;
3030
use io;
3131
use libc;
32-
use libc::{c_char, c_void, c_int, size_t};
32+
use libc::{c_char, c_void, c_int, c_uint, size_t, ssize_t};
3333
use libc::{mode_t, pid_t, FILE};
3434
use option;
3535
use option::{Some, None};
@@ -397,7 +397,7 @@ pub fn pipe() -> Pipe {
397397
// first, as in rust_run_program.
398398
let mut fds = Pipe {in: 0 as c_int,
399399
out: 0 as c_int };
400-
let res = libc::pipe(&mut fds.in, 1024 as ::libc::c_uint,
400+
let res = libc::pipe(&mut fds.in, 1024 as c_uint,
401401
(libc::O_BINARY | libc::O_NOINHERIT) as c_int);
402402
fail_unless!((res == 0 as c_int));
403403
fail_unless!((fds.in != -1 as c_int && fds.in != 0 as c_int));
@@ -431,7 +431,7 @@ pub fn self_exe_path() -> Option<Path> {
431431
KERN_PROC as c_int,
432432
KERN_PROC_PATHNAME as c_int, -1 as c_int];
433433
let mut sz = sz;
434-
sysctl(vec::raw::to_ptr(mib), vec::len(mib) as ::libc::c_uint,
434+
sysctl(vec::raw::to_ptr(mib), vec::len(mib) as c_uint,
435435
buf as *mut c_void, &mut sz, ptr::null(),
436436
0u as size_t) == (0 as c_int)
437437
}
@@ -670,7 +670,7 @@ pub fn list_dir(p: &Path) -> ~[~str] {
670670
#[cfg(target_os = "freebsd")]
671671
#[cfg(target_os = "macos")]
672672
unsafe fn get_list(p: &Path) -> ~[~str] {
673-
use libc::{dirent_t};
673+
use libc::{DIR, dirent_t};
674674
use libc::{opendir, readdir, closedir};
675675
extern mod rustrt {
676676
unsafe fn rust_list_dir_val(ptr: *dirent_t)
@@ -1257,7 +1257,7 @@ pub mod consts {
12571257
mod tests {
12581258
use libc::{c_int, c_void, size_t};
12591259
use libc;
1260-
use option::Some;
1260+
use option::{None, Option, Some};
12611261
use option;
12621262
use os::{as_c_charp, env, getcwd, getenv, make_absolute, real_args};
12631263
use os::{remove_file, setenv};

branches/auto/src/libcore/pipes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,9 +958,9 @@ pub mod rt {
958958
959959
#[cfg(test)]
960960
pub mod test {
961-
use either::Right;
961+
use either::{Either, Left, Right};
962962
use comm::{Chan, Port, oneshot, recv_one, stream, Select2,
963-
GenericChan, Peekable};
963+
GenericPort, GenericChan, Peekable};
964964
965965
#[test]
966966
pub fn test_select2() {

branches/auto/src/libcore/prelude.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ pub use ops::{Shl, Shr, Index};
2121
pub use option::{Option, Some, None};
2222
pub use result::{Result, Ok, Err};
2323

24-
/* Reexported functions */
25-
26-
pub use io::{print, println};
27-
2824
/* Reexported types and traits */
2925

3026
pub use clone::Clone;

branches/auto/src/libcore/ptr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use cast;
1414
use libc;
1515
use libc::{c_void, size_t};
16+
use unstable::intrinsics::{memmove32,memmove64};
1617
use sys;
1718

1819
#[cfg(test)] use vec;
@@ -115,14 +116,12 @@ pub fn is_not_null<T>(ptr: *const T) -> bool { !is_null(ptr) }
115116
#[inline(always)]
116117
#[cfg(target_word_size = "32")]
117118
pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
118-
use unstable::intrinsics::memmove32;
119119
let n = count * sys::size_of::<T>();
120120
memmove32(dst as *mut u8, src as *u8, n as u32);
121121
}
122122
#[inline(always)]
123123
#[cfg(target_word_size = "64")]
124124
pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
125-
use unstable::intrinsics::memmove64;
126125
let n = count * sys::size_of::<T>();
127126
memmove64(dst as *mut u8, src as *u8, n as u64);
128127
}

branches/auto/src/libcore/rand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ pub fn random() -> uint {
574574

575575
#[cfg(test)]
576576
pub mod tests {
577-
use option::{Option, Some};
577+
use option::{None, Option, Some};
578578
use rand;
579579

580580
#[test]

branches/auto/src/libcore/reflect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Runtime type reflection
1414
1515
*/
1616

17-
use intrinsic::{TyDesc, TyVisitor};
17+
use intrinsic::{TyDesc, get_tydesc, visit_tydesc, TyVisitor};
1818
use libc::c_void;
1919
use sys;
2020
use vec;

branches/auto/src/libcore/repr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use libc::c_void;
2323
use managed;
2424
use ptr;
2525
use reflect;
26-
use reflect::{MovePtr, align};
26+
use reflect::{MovePtr, MovePtrAdaptor, align};
2727
use sys;
2828
use to_str::ToStr;
2929
use vec::UnboxedVecRepr;

branches/auto/src/libcore/rt/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp:
160160
type Registers = [uint, ..32];
161161

162162
#[cfg(target_arch = "arm")]
163-
fn new_regs() -> ~Registers { ~([0, .. 32]) }
163+
fn new_regs() -> ~Registers { ~[0, .. 32] }
164164

165165
#[cfg(target_arch = "arm")]
166166
fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp: *mut uint) {
@@ -178,7 +178,7 @@ fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp:
178178
type Registers = [uint, ..32];
179179

180180
#[cfg(target_arch = "mips")]
181-
fn new_regs() -> ~Registers { ~([0, .. 32]) }
181+
fn new_regs() -> ~Registers { ~[0, .. 32] }
182182

183183
#[cfg(target_arch = "mips")]
184184
fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp: *mut uint) {

0 commit comments

Comments
 (0)