Skip to content

Commit 368ccf8

Browse files
author
blake2-ppc
committed
---
yaml --- r: 143222 b: refs/heads/try2 c: 5991c60 h: refs/heads/master v: v3
1 parent a8f7962 commit 368ccf8

File tree

464 files changed

+13515
-10222
lines changed

Some content is hidden

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

464 files changed

+13515
-10222
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: 4a726f0573dcfcd01ae9b37266014df0e26f2e22
8+
refs/heads/try2: 5991c607501595b32998a3367171ca42f5d8ef0b
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/tutorial-container.md

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,15 @@ let mut it = xs.iter().zip(ys.iter());
192192

193193
// print out the pairs of elements up to (&3, &"baz")
194194
for it.advance |(x, y)| {
195-
printfln!("%d %s", *x, *y);
195+
println(fmt!("%d %s", *x, *y));
196196

197197
if *x == 3 {
198198
break;
199199
}
200200
}
201201

202202
// yield and print the last pair from the iterator
203-
printfln!("last: %?", it.next());
203+
println(fmt!("last: %?", it.next()));
204204

205205
// the iterator is now fully consumed
206206
assert!(it.next().is_none());
@@ -294,59 +294,15 @@ another `DoubleEndedIterator` with `next` and `next_back` exchanged.
294294
~~~
295295
let xs = [1, 2, 3, 4, 5, 6];
296296
let mut it = xs.iter();
297-
printfln!("%?", it.next()); // prints `Some(&1)`
298-
printfln!("%?", it.next()); // prints `Some(&2)`
299-
printfln!("%?", it.next_back()); // prints `Some(&6)`
297+
println(fmt!("%?", it.next())); // prints `Some(&1)`
298+
println(fmt!("%?", it.next())); // prints `Some(&2)`
299+
println(fmt!("%?", it.next_back())); // prints `Some(&6)`
300300

301301
// prints `5`, `4` and `3`
302302
for it.invert().advance |&x| {
303-
printfln!("%?", x)
303+
println(fmt!("%?", x))
304304
}
305305
~~~
306306
307307
The `rev_iter` and `mut_rev_iter` methods on vectors just return an inverted
308308
version of the standard immutable and mutable vector iterators.
309-
310-
The `chain_`, `transform`, `filter`, `filter_map` and `peek` adaptors are
311-
`DoubleEndedIterator` implementations if the underlying iterators are.
312-
313-
~~~
314-
let xs = [1, 2, 3, 4];
315-
let ys = [5, 6, 7, 8];
316-
let mut it = xs.iter().chain_(ys.iter()).transform(|&x| x * 2);
317-
318-
printfln!("%?", it.next()); // prints `Some(2)`
319-
320-
// prints `16`, `14`, `12`, `10`, `8`, `6`, `4`
321-
for it.invert().advance |x| {
322-
printfln!("%?", x);
323-
}
324-
~~~
325-
326-
## Random-access iterators
327-
328-
The `RandomAccessIterator` trait represents an iterator offering random access
329-
to the whole range. The `indexable` method retrieves the number of elements
330-
accessible with the `idx` method.
331-
332-
The `chain_` adaptor is an implementation of `RandomAccessIterator` if the
333-
underlying iterators are.
334-
335-
~~~
336-
let xs = [1, 2, 3, 4, 5];
337-
let ys = ~[7, 9, 11];
338-
let mut it = xs.iter().chain_(ys.iter());
339-
printfln!("%?", it.idx(0)); // prints `Some(&1)`
340-
printfln!("%?", it.idx(5)); // prints `Some(&7)`
341-
printfln!("%?", it.idx(7)); // prints `Some(&11)`
342-
printfln!("%?", it.idx(8)); // prints `None`
343-
344-
// yield two elements from the beginning, and one from the end
345-
it.next();
346-
it.next();
347-
it.next_back();
348-
349-
printfln!("%?", it.idx(0)); // prints `Some(&3)`
350-
printfln!("%?", it.idx(4)); // prints `Some(&9)`
351-
printfln!("%?", it.idx(6)); // prints `None`
352-
~~~

branches/try2/doc/tutorial.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ types.
499499
> items.
500500
501501
~~~~
502-
use std::float;
503-
use std::num::atan;
502+
# use std::float;
503+
# use std::num::atan;
504504
fn angle(vector: (float, float)) -> float {
505505
let pi = float::consts::pi;
506506
match vector {
@@ -555,7 +555,7 @@ while cake_amount > 0 {
555555
`loop` denotes an infinite loop, and is the preferred way of writing `while true`:
556556

557557
~~~~
558-
use std::int;
558+
# use std::int;
559559
let mut x = 5;
560560
loop {
561561
x += x - 3;
@@ -701,7 +701,7 @@ get at their contents. All variant constructors can be used as
701701
patterns, as in this definition of `area`:
702702

703703
~~~~
704-
use std::float;
704+
# use std::float;
705705
# struct Point {x: float, y: float}
706706
# enum Shape { Circle(Point, float), Rectangle(Point, Point) }
707707
fn area(sh: Shape) -> float {
@@ -733,7 +733,7 @@ fn point_from_direction(dir: Direction) -> Point {
733733
Enum variants may also be structs. For example:
734734

735735
~~~~
736-
use std::float;
736+
# use std::float;
737737
# struct Point { x: float, y: float }
738738
# fn square(x: float) -> float { x * x }
739739
enum Shape {
@@ -1599,8 +1599,7 @@ lists back to back. Since that is so unsightly, empty argument lists
15991599
may be omitted from `do` expressions.
16001600

16011601
~~~~
1602-
use std::task::spawn;
1603-
1602+
# use std::task::spawn;
16041603
do spawn {
16051604
debug!("Kablam!");
16061605
}
@@ -1729,7 +1728,7 @@ impl Circle {
17291728
To call such a method, just prefix it with the type name and a double colon:
17301729

17311730
~~~~
1732-
use std::float::consts::pi;
1731+
# use std::float::consts::pi;
17331732
struct Circle { radius: float }
17341733
impl Circle {
17351734
fn new(area: float) -> Circle { Circle { radius: (area / pi).sqrt() } }
@@ -1775,7 +1774,7 @@ illegal to copy and pass by value.
17751774
Generic `type`, `struct`, and `enum` declarations follow the same pattern:
17761775

17771776
~~~~
1778-
use std::hashmap::HashMap;
1777+
# use std::hashmap::HashMap;
17791778
type Set<T> = HashMap<T, ()>;
17801779
17811780
struct Stack<T> {
@@ -2001,7 +2000,7 @@ name and a double colon. The compiler uses type inference to decide which
20012000
implementation to use.
20022001

20032002
~~~~
2004-
use std::float::consts::pi;
2003+
# use std::float::consts::pi;
20052004
trait Shape { fn new(area: float) -> Self; }
20062005
struct Circle { radius: float }
20072006
struct Square { length: float }
@@ -2157,7 +2156,7 @@ trait Circle : Shape { fn radius(&self) -> float; }
21572156
Now, we can implement `Circle` on a type only if we also implement `Shape`.
21582157

21592158
~~~~
2160-
use std::float::consts::pi;
2159+
# use std::float::consts::pi;
21612160
# trait Shape { fn area(&self) -> float; }
21622161
# trait Circle : Shape { fn radius(&self) -> float; }
21632162
# struct Point { x: float, y: float }
@@ -2192,7 +2191,7 @@ fn radius_times_area<T: Circle>(c: T) -> float {
21922191
Likewise, supertrait methods may also be called on trait objects.
21932192

21942193
~~~ {.xfail-test}
2195-
use std::float::consts::pi;
2194+
# use std::float::consts::pi;
21962195
# trait Shape { fn area(&self) -> float; }
21972196
# trait Circle : Shape { fn radius(&self) -> float; }
21982197
# struct Point { x: float, y: float }

branches/try2/mk/snap.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ define DEF_SNAP_FOR_STAGE_H
1212
# $(1) stage
1313
# $(2) triple
1414

15+
ifdef CFG_INSTALL_SNAP
16+
snap-stage$(1)-H-$(2): $$(HSREQ$(1)_H_$(2))
17+
$(CFG_PYTHON) $(S)src/etc/make-snapshot.py stage$(1) $(2) install
18+
else
1519
snap-stage$(1)-H-$(2): $$(HSREQ$(1)_H_$(2))
1620
$(CFG_PYTHON) $(S)src/etc/make-snapshot.py stage$(1) $(2)
21+
endif
1722

1823
endef
1924

branches/try2/mk/target.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export CFG_COMPILER_TRIPLE
1717
# code, make sure that these common warnings are denied by default. These can
1818
# be overridden during development temporarily. For stage0, we allow all these
1919
# to suppress warnings which may be bugs in stage0 (should be fixed in stage1+)
20-
WFLAGS_ST0 = -A warnings
20+
# NOTE: add "-A warnings" after snapshot to WFLAGS_ST0
21+
WFLAGS_ST0 = -A unrecognized-lint
2122
WFLAGS_ST1 = -D warnings
2223
WFLAGS_ST2 = -D warnings
2324

branches/try2/src/compiletest/compiletest.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,13 @@ pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
242242
let mut tests = ~[];
243243
let dirs = os::list_dir_path(&config.src_base);
244244
for dirs.iter().advance |file| {
245-
let file = file.clone();
245+
let file = (*file).clone();
246246
debug!("inspecting file %s", file.to_str());
247-
if is_test(config, &file) {
248-
let t = do make_test(config, &file) {
247+
if is_test(config, file) {
248+
let t = do make_test(config, file) {
249249
match config.mode {
250-
mode_codegen => make_metrics_test_closure(config, &file),
251-
_ => make_test_closure(config, &file)
250+
mode_codegen => make_metrics_test_closure(config, file),
251+
_ => make_test_closure(config, file)
252252
}
253253
};
254254
tests.push(t)

branches/try2/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
292292
}
293293
}
294294
if i != num_check_lines {
295-
fatal_ProcRes(fmt!("line not found in debugger output: %s",
295+
fatal_ProcRes(fmt!("line not found in debugger output: %s"
296296
check_lines[i]), &ProcRes);
297297
}
298298
}

branches/try2/src/etc/emacs/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,3 @@ marking, press x, and ELPA will install the packages for you (under
9898
~/.emacs.d/elpa/).
9999

100100
* or using <kbd>M-x package-install rust-mode
101-
102-
### Known bugs
103-
104-
* Combining `global-whitespace-mode` and `rust-mode` is generally glitchy.
105-
See [Issue #3994](https://github.com/mozilla/rust/issues/3994).

branches/try2/src/etc/extract-tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
if not re.search(r"\bextern mod extra\b", block):
6161
block = "extern mod extra;\n" + block
6262
block = """#[ forbid(ctypes) ];
63+
#[ forbid(deprecated_pattern) ];
64+
#[ forbid(implicit_copies) ];
65+
#[ forbid(non_implicitly_copyable_typarams) ];
6366
#[ forbid(path_statement) ];
6467
#[ forbid(type_limits) ];
6568
#[ forbid(unrecognized_lint) ];

branches/try2/src/etc/make-snapshot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33

44
import snapshot, sys
55

6-
print(snapshot.make_snapshot(sys.argv[1], sys.argv[2]))
6+
if len(sys.argv) == 3:
7+
print(snapshot.make_snapshot(sys.argv[1], sys.argv[2], ""))
8+
else:
9+
print(snapshot.make_snapshot(sys.argv[1], sys.argv[2], sys.argv[3]))

branches/try2/src/etc/snapshot.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def hash_file(x):
156156
return scrub(h.hexdigest())
157157

158158

159-
def make_snapshot(stage, triple):
159+
def make_snapshot(stage, triple, flag):
160160
kernel = get_kernel(triple)
161161
platform = get_platform(triple)
162162
rev = local_rev_short_sha()
@@ -190,4 +190,33 @@ def in_tar_name(fn):
190190

191191
shutil.move(file0, file1)
192192

193+
if flag == "install":
194+
# FIXME (#2664): this is an ugly quick hack; pls make it better
195+
path = file1
196+
comps = path.split("-")
197+
parts = { 'year': comps[2], \
198+
'month': comps[3], \
199+
'date': comps[4], \
200+
'check': comps[5], \
201+
'plat': comps[6], \
202+
'arch': comps[7], \
203+
'sha': comps[8].split(".")[0] }
204+
205+
shutil.move(path, "dl/" + path)
206+
shutil.move('src/snapshots.txt', 'src/snapshots-old.txt')
207+
208+
newf = open('src/snapshots.txt', 'w')
209+
newf.write("T %(year)s-%(month)s-%(date)s %(check)s\n" % parts)
210+
newf.write(" %(plat)s-%(arch)s %(sha)s\n\n" % parts)
211+
212+
oldf = open('src/snapshots-old.txt', 'r')
213+
for line in oldf:
214+
newf.write(line)
215+
oldf.close()
216+
217+
newf.close()
218+
219+
os.remove('src/snapshots-old.txt')
220+
221+
193222
return file1

branches/try2/src/etc/tidy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def do_license_check(name, contents):
4949
report_err("FIXME without issue number")
5050
if line.find("TODO") != -1:
5151
report_err("TODO is deprecated; use FIXME")
52-
match = re.match(r'^.*//\s*(NOTE.*)$', line)
53-
if match:
54-
report_warn(match.group(1))
52+
idx = line.find("// NOTE")
53+
if idx != -1:
54+
report_warn("NOTE" + line[idx + len("// NOTE"):])
5555
if (line.find('\t') != -1 and
5656
fileinput.filename().find("Makefile") == -1):
5757
report_err("tab character")

branches/try2/src/etc/zsh/_rust

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ _rustc_opts_switches=(
3333
)
3434
_rustc_opts_lint=(
3535
'path-statement[path statements with no effect]'
36+
'deprecated-pattern[warn about deprecated uses of pattern bindings]'
37+
'non-implicitly-copyable-typarams[passing non implicitly copyable types as copy type params]'
3638
'missing-trait-doc[detects missing documentation for traits]'
3739
'missing-struct-doc[detects missing documentation for structs]'
3840
'ctypes[proper use of core::libc types in foreign modules]'
41+
'implicit-copies[implicit copies of non implicitly copyable data]'
3942
"unused-mut[detect mut variables which don't need to be mutable]"
4043
'unused-imports[imports that are never used]'
4144
'heap-memory[use of any (~ type or @ type) heap memory]'

branches/try2/src/libextra/arc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ struct RWARCInner<T> { priv lock: RWlock, priv failed: bool, priv data: T }
305305
*
306306
* Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested.
307307
*/
308+
#[mutable] // XXX remove after snap
308309
#[no_freeze]
309310
struct RWARC<T> {
310311
priv x: UnsafeAtomicRcBox<RWARCInner<T>>,

branches/try2/src/libextra/arena.rs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@ use std::sys;
4646
use std::uint;
4747
use std::vec;
4848
use std::unstable::intrinsics;
49-
use std::unstable::intrinsics::{TyDesc, get_tydesc};
49+
use std::unstable::intrinsics::{TyDesc};
50+
51+
#[cfg(not(stage0))]
52+
use std::unstable::intrinsics::{get_tydesc};
53+
54+
#[cfg(stage0)]
55+
unsafe fn get_tydesc<T>() -> *TyDesc {
56+
intrinsics::get_tydesc::<T>() as *TyDesc
57+
}
5058

5159
// The way arena uses arrays is really deeply awful. The arrays are
5260
// allocated, and have capacities reserved, but the fill for the array
@@ -57,6 +65,7 @@ struct Chunk {
5765
is_pod: bool,
5866
}
5967

68+
#[mutable] // XXX remove after snap
6069
#[no_freeze]
6170
pub struct Arena {
6271
// The head is separated out from the list as a unbenchmarked
@@ -108,6 +117,19 @@ fn round_up_to(base: uint, align: uint) -> uint {
108117
(base + (align - 1)) & !(align - 1)
109118
}
110119

120+
#[inline]
121+
#[cfg(not(stage0))]
122+
unsafe fn call_drop_glue(tydesc: *TyDesc, data: *i8) {
123+
// This function should be inlined when stage0 is gone
124+
((*tydesc).drop_glue)(data);
125+
}
126+
127+
#[inline]
128+
#[cfg(stage0)]
129+
unsafe fn call_drop_glue(tydesc: *TyDesc, data: *i8) {
130+
((*tydesc).drop_glue)(0 as **TyDesc, data);
131+
}
132+
111133
// Walk down a chunk, running the destructors for any objects stored
112134
// in it.
113135
unsafe fn destroy_chunk(chunk: &Chunk) {
@@ -127,7 +149,7 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
127149
//debug!("freeing object: idx = %u, size = %u, align = %u, done = %b",
128150
// start, size, align, is_done);
129151
if is_done {
130-
((*tydesc).drop_glue)(ptr::offset(buf, start) as *i8);
152+
call_drop_glue(tydesc, ptr::offset(buf, start) as *i8);
131153
}
132154

133155
// Find where the next tydesc lives

0 commit comments

Comments
 (0)