Skip to content

Commit db503ce

Browse files
committed
---
yaml --- r: 112873 b: refs/heads/auto c: a3f9f37 h: refs/heads/master i: 112871: 16dcbee v: v3
1 parent ca12a6f commit db503ce

File tree

23 files changed

+1319
-425
lines changed

23 files changed

+1319
-425
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: 63ee7bb0db642e43e19b8ec597521858805ad21e
16+
refs/heads/auto: a3f9f37014c77cda1ae53bf0984190e877aa413a
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ Two examples of paths with type arguments:
471471
# fn f() {
472472
# fn id<T>(t: T) -> T { t }
473473
type T = HashMap<int,~str>; // Type arguments used in a type expression
474-
let x = id::<int>(10); // Type arguments used in a call expression
474+
let x = id::<int>(10); // Type arguments used in a call expression
475475
# }
476476
~~~~
477477

branches/auto/src/doc/tutorial.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,8 @@ The obvious approach is to define `Cons` as containing an element in the list
982982
along with the next `List` node. However, this will generate a compiler error.
983983

984984
~~~ {.ignore}
985-
// error: illegal recursive enum type; wrap the inner value in a box to make it representable
985+
// error: illegal recursive enum type; wrap the inner value in a box to make it
986+
// representable
986987
enum List {
987988
Cons(u32, List), // an element (`u32`) and the next node in the list
988989
Nil
@@ -1054,10 +1055,10 @@ immutable, the whole list is immutable. The memory allocation itself is the
10541055
box, while the owner holds onto a pointer to it:
10551056

10561057
~~~ {.notrust}
1057-
List box List box List box List box
1058-
+--------------+ +--------------+ +--------------+ +--------------+
1059-
list -> | Cons | 1 | ~ | -> | Cons | 2 | ~ | -> | Cons | 3 | ~ | -> | Nil |
1060-
+--------------+ +--------------+ +--------------+ +--------------+
1058+
List box List box List box List box
1059+
+--------------+ +--------------+ +--------------+ +----------+
1060+
list -> | Cons | 1 | ~ | -> | Cons | 2 | ~ | -> | Cons | 3 | ~ | -> | Nil |
1061+
+--------------+ +--------------+ +--------------+ +----------+
10611062
~~~
10621063

10631064
> *Note:* the above diagram shows the logical contents of the enum. The actual
@@ -1197,7 +1198,8 @@ fn eq(xs: &List, ys: &List) -> bool {
11971198
// If we have reached the end of both lists, they are equal.
11981199
(&Nil, &Nil) => true,
11991200
// If the current element in both lists is equal, keep going.
1200-
(&Cons(x, ~ref next_xs), &Cons(y, ~ref next_ys)) if x == y => eq(next_xs, next_ys),
1201+
(&Cons(x, ~ref next_xs), &Cons(y, ~ref next_ys))
1202+
if x == y => eq(next_xs, next_ys),
12011203
// If the current elements are not equal, the lists are not equal.
12021204
_ => false
12031205
}
@@ -1256,7 +1258,7 @@ Using the generic `List<T>` works much like before, thanks to type inference:
12561258
# Cons(value, ~xs)
12571259
# }
12581260
let mut xs = Nil; // Unknown type! This is a `List<T>`, but `T` can be anything.
1259-
xs = prepend(xs, 10); // The compiler infers the type of `xs` as `List<int>` from this.
1261+
xs = prepend(xs, 10); // Here the compiler infers `xs`'s type as `List<int>`.
12601262
xs = prepend(xs, 15);
12611263
xs = prepend(xs, 20);
12621264
~~~
@@ -1303,7 +1305,8 @@ fn eq<T: Eq>(xs: &List<T>, ys: &List<T>) -> bool {
13031305
// If we have reached the end of both lists, they are equal.
13041306
(&Nil, &Nil) => true,
13051307
// If the current element in both lists is equal, keep going.
1306-
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys)) if x == y => eq(next_xs, next_ys),
1308+
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys))
1309+
if x == y => eq(next_xs, next_ys),
13071310
// If the current elements are not equal, the lists are not equal.
13081311
_ => false
13091312
}
@@ -1331,7 +1334,8 @@ impl<T: Eq> Eq for List<T> {
13311334
// If we have reached the end of both lists, they are equal.
13321335
(&Nil, &Nil) => true,
13331336
// If the current element in both lists is equal, keep going.
1334-
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys)) if x == y => next_xs == next_ys,
1337+
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys))
1338+
if x == y => next_xs == next_ys,
13351339
// If the current elements are not equal, the lists are not equal.
13361340
_ => false
13371341
}

branches/auto/src/liblibc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ pub use funcs::bsd43::{shutdown};
231231
#[cfg(windows)] pub use types::os::arch::extra::{HANDLE, BOOL, LPSECURITY_ATTRIBUTES};
232232
#[cfg(windows)] pub use types::os::arch::extra::{LPCSTR, WORD, DWORD, BYTE, FILETIME};
233233
#[cfg(windows)] pub use types::os::arch::extra::{LARGE_INTEGER, LPVOID, LONG};
234-
#[cfg(windows)] pub use types::os::arch::extra::{time64_t, OVERLAPPED};
234+
#[cfg(windows)] pub use types::os::arch::extra::{time64_t, OVERLAPPED, LPCWSTR};
235235
#[cfg(windows)] pub use types::os::arch::extra::{LPOVERLAPPED, SIZE_T, LPDWORD};
236236
#[cfg(windows)] pub use funcs::c95::string::{wcslen};
237237
#[cfg(windows)] pub use funcs::posix88::stat_::{wstat, wutime, wchmod, wrmdir};

branches/auto/src/libregex/compile.rs

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![allow(visible_private_types)]
1414

1515
use std::cmp;
16-
use std::iter;
1716
use parse;
1817
use parse::{
1918
Flags, FLAG_EMPTY,
@@ -89,7 +88,7 @@ pub struct Program {
8988

9089
impl Program {
9190
/// Compiles a Regex given its AST.
92-
pub fn new(ast: ~parse::Ast) -> (Program, ~[Option<~str>]) {
91+
pub fn new(ast: parse::Ast) -> (Program, Vec<Option<~str>>) {
9392
let mut c = Compiler {
9493
insts: Vec::with_capacity(100),
9594
names: Vec::with_capacity(10),
@@ -104,16 +103,16 @@ impl Program {
104103
// This is a bit hacky since we have to skip over the initial
105104
// 'Save' instruction.
106105
let mut pre = StrBuf::with_capacity(5);
107-
for i in iter::range(1, c.insts.len()) {
108-
match *c.insts.get(i) {
106+
for inst in c.insts.slice_from(1).iter() {
107+
match *inst {
109108
OneChar(c, FLAG_EMPTY) => pre.push_char(c),
110109
_ => break
111110
}
112111
}
113112

114-
let names = c.names.as_slice().into_owned();
113+
let Compiler { insts, names } = c;
115114
let prog = Program {
116-
insts: c.insts,
115+
insts: insts,
117116
prefix: pre.into_owned(),
118117
};
119118
(prog, names)
@@ -144,48 +143,48 @@ struct Compiler<'r> {
144143
// The only tricky thing here is patching jump/split instructions to point to
145144
// the right instruction.
146145
impl<'r> Compiler<'r> {
147-
fn compile(&mut self, ast: ~parse::Ast) {
146+
fn compile(&mut self, ast: parse::Ast) {
148147
match ast {
149-
~Nothing => {},
150-
~Literal(c, flags) => self.push(OneChar(c, flags)),
151-
~Dot(nl) => self.push(Any(nl)),
152-
~Class(ranges, flags) =>
148+
Nothing => {},
149+
Literal(c, flags) => self.push(OneChar(c, flags)),
150+
Dot(nl) => self.push(Any(nl)),
151+
Class(ranges, flags) =>
153152
self.push(CharClass(ranges, flags)),
154-
~Begin(flags) => self.push(EmptyBegin(flags)),
155-
~End(flags) => self.push(EmptyEnd(flags)),
156-
~WordBoundary(flags) => self.push(EmptyWordBoundary(flags)),
157-
~Capture(cap, name, x) => {
153+
Begin(flags) => self.push(EmptyBegin(flags)),
154+
End(flags) => self.push(EmptyEnd(flags)),
155+
WordBoundary(flags) => self.push(EmptyWordBoundary(flags)),
156+
Capture(cap, name, x) => {
158157
let len = self.names.len();
159158
if cap >= len {
160159
self.names.grow(10 + cap - len, &None)
161160
}
162161
*self.names.get_mut(cap) = name;
163162

164163
self.push(Save(2 * cap));
165-
self.compile(x);
164+
self.compile(*x);
166165
self.push(Save(2 * cap + 1));
167166
}
168-
~Cat(xs) => {
167+
Cat(xs) => {
169168
for x in xs.move_iter() {
170169
self.compile(x)
171170
}
172171
}
173-
~Alt(x, y) => {
172+
Alt(x, y) => {
174173
let split = self.empty_split(); // push: split 0, 0
175174
let j1 = self.insts.len();
176-
self.compile(x); // push: insts for x
175+
self.compile(*x); // push: insts for x
177176
let jmp = self.empty_jump(); // push: jmp 0
178177
let j2 = self.insts.len();
179-
self.compile(y); // push: insts for y
178+
self.compile(*y); // push: insts for y
180179
let j3 = self.insts.len();
181180

182181
self.set_split(split, j1, j2); // split 0, 0 -> split j1, j2
183182
self.set_jump(jmp, j3); // jmp 0 -> jmp j3
184183
}
185-
~Rep(x, ZeroOne, g) => {
184+
Rep(x, ZeroOne, g) => {
186185
let split = self.empty_split();
187186
let j1 = self.insts.len();
188-
self.compile(x);
187+
self.compile(*x);
189188
let j2 = self.insts.len();
190189

191190
if g.is_greedy() {
@@ -194,11 +193,11 @@ impl<'r> Compiler<'r> {
194193
self.set_split(split, j2, j1);
195194
}
196195
}
197-
~Rep(x, ZeroMore, g) => {
196+
Rep(x, ZeroMore, g) => {
198197
let j1 = self.insts.len();
199198
let split = self.empty_split();
200199
let j2 = self.insts.len();
201-
self.compile(x);
200+
self.compile(*x);
202201
let jmp = self.empty_jump();
203202
let j3 = self.insts.len();
204203

@@ -209,9 +208,9 @@ impl<'r> Compiler<'r> {
209208
self.set_split(split, j3, j2);
210209
}
211210
}
212-
~Rep(x, OneMore, g) => {
211+
Rep(x, OneMore, g) => {
213212
let j1 = self.insts.len();
214-
self.compile(x);
213+
self.compile(*x);
215214
let split = self.empty_split();
216215
let j2 = self.insts.len();
217216

branches/auto/src/libregex/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@
362362
html_root_url = "http://static.rust-lang.org/doc/master")]
363363

364364
#![feature(macro_rules, phase)]
365-
#![deny(missing_doc)]
365+
#![deny(missing_doc, deprecated_owned_vector)]
366366

367367
extern crate collections;
368368
#[cfg(test)]

0 commit comments

Comments
 (0)