Skip to content

Commit 7603e9b

Browse files
committed
---
yaml --- r: 151199 b: refs/heads/try2 c: de14a73 h: refs/heads/master i: 151197: 3fee7d8 151195: 1bc4e55 151191: 82bce19 151183: 13d5b80 151167: d4ea20f v: v3
1 parent de04d77 commit 7603e9b

Some content is hidden

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

85 files changed

+1039
-1923
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ad37c0b97c1a5403268e2addbcae28c51d15a924
8+
refs/heads/try2: de14a739ae27088acaa3c5e21949a39bffd5313b
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/tests.mk

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,6 @@ TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
349349
$$(foreach crate,$$(TARGET_CRATES),\
350350
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
351351
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
352-
353-
# The regex crate depends on the regex_macros crate during testing, but it
354-
# notably depend on the *host* regex_macros crate, not the target version.
355-
# Additionally, this is not a dependency in stage1, only in stage2.
356-
ifeq ($(4),regex)
357-
ifneq ($(1),1)
358-
TESTDEP_$(1)_$(2)_$(3)_$(4) += $$(TLIB$(1)_T_$(3)_H_$(3))/stamp.regex_macros
359-
endif
360-
endif
361-
362352
else
363353
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
364354
endif

branches/try2/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/try2/src/doc/tutorial.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -982,8 +982,7 @@ 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
986-
// representable
985+
// error: illegal recursive enum type; wrap the inner value in a box to make it representable
987986
enum List {
988987
Cons(u32, List), // an element (`u32`) and the next node in the list
989988
Nil
@@ -1055,10 +1054,10 @@ immutable, the whole list is immutable. The memory allocation itself is the
10551054
box, while the owner holds onto a pointer to it:
10561055

10571056
~~~ {.notrust}
1058-
List box List box List box List box
1059-
+--------------+ +--------------+ +--------------+ +----------+
1060-
list -> | Cons | 1 | ~ | -> | Cons | 2 | ~ | -> | Cons | 3 | ~ | -> | Nil |
1061-
+--------------+ +--------------+ +--------------+ +----------+
1057+
List box List box List box List box
1058+
+--------------+ +--------------+ +--------------+ +--------------+
1059+
list -> | Cons | 1 | ~ | -> | Cons | 2 | ~ | -> | Cons | 3 | ~ | -> | Nil |
1060+
+--------------+ +--------------+ +--------------+ +--------------+
10621061
~~~
10631062

10641063
> *Note:* the above diagram shows the logical contents of the enum. The actual
@@ -1198,8 +1197,7 @@ fn eq(xs: &List, ys: &List) -> bool {
11981197
// If we have reached the end of both lists, they are equal.
11991198
(&Nil, &Nil) => true,
12001199
// If the current element in both lists is equal, keep going.
1201-
(&Cons(x, ~ref next_xs), &Cons(y, ~ref next_ys))
1202-
if x == y => eq(next_xs, next_ys),
1200+
(&Cons(x, ~ref next_xs), &Cons(y, ~ref next_ys)) if x == y => eq(next_xs, next_ys),
12031201
// If the current elements are not equal, the lists are not equal.
12041202
_ => false
12051203
}
@@ -1258,7 +1256,7 @@ Using the generic `List<T>` works much like before, thanks to type inference:
12581256
# Cons(value, ~xs)
12591257
# }
12601258
let mut xs = Nil; // Unknown type! This is a `List<T>`, but `T` can be anything.
1261-
xs = prepend(xs, 10); // Here the compiler infers `xs`'s type as `List<int>`.
1259+
xs = prepend(xs, 10); // The compiler infers the type of `xs` as `List<int>` from this.
12621260
xs = prepend(xs, 15);
12631261
xs = prepend(xs, 20);
12641262
~~~
@@ -1305,8 +1303,7 @@ fn eq<T: Eq>(xs: &List<T>, ys: &List<T>) -> bool {
13051303
// If we have reached the end of both lists, they are equal.
13061304
(&Nil, &Nil) => true,
13071305
// If the current element in both lists is equal, keep going.
1308-
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys))
1309-
if x == y => eq(next_xs, next_ys),
1306+
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys)) if x == y => eq(next_xs, next_ys),
13101307
// If the current elements are not equal, the lists are not equal.
13111308
_ => false
13121309
}
@@ -1334,8 +1331,7 @@ impl<T: Eq> Eq for List<T> {
13341331
// If we have reached the end of both lists, they are equal.
13351332
(&Nil, &Nil) => true,
13361333
// If the current element in both lists is equal, keep going.
1337-
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys))
1338-
if x == y => next_xs == next_ys,
1334+
(&Cons(ref x, ~ref next_xs), &Cons(ref y, ~ref next_ys)) if x == y => next_xs == next_ys,
13391335
// If the current elements are not equal, the lists are not equal.
13401336
_ => false
13411337
}

branches/try2/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, LPCWSTR};
234+
#[cfg(windows)] pub use types::os::arch::extra::{time64_t, OVERLAPPED};
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/try2/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/try2/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)