Skip to content

Commit 5716ef2

Browse files
committed
---
yaml --- r: 100919 b: refs/heads/snap-stage3 c: fd2ed71 h: refs/heads/master i: 100917: 70d833b 100915: c45df86 100911: b01adfc v: v3
1 parent c82731d commit 5716ef2

Some content is hidden

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

62 files changed

+791
-1809
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e3b1f3c443c048913e2d573fcc5a9c2be3484a78
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 8391b71122cd88bcfb729f868b662ffdad61b583
4+
refs/heads/snap-stage3: fd2ed71dcc35612db900c07d652a849bf630d68e
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/tests.mk

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,6 @@ tidy:
247247
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
248248
$(Q)find $(S)src/etc -name '*.py' \
249249
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
250-
$(Q)find $(S)src/doc -name '*.js' \
251-
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
252-
$(Q)find $(S)src/etc -name '*.sh' \
253-
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
254-
$(Q)find $(S)src/etc -name '*.pl' \
255-
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
256-
$(Q)find $(S)src/etc -name '*.c' \
257-
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
258-
$(Q)find $(S)src/etc -name '*.h' \
259-
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
260250
$(Q)echo $(ALL_CS) \
261251
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
262252
$(Q)echo $(ALL_HS) \

branches/snap-stage3/src/doc/guide-tasks.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ spawn(proc() {
226226
});
227227
~~~
228228

229-
Instead we can clone the `chan`, which allows for multiple senders.
229+
Instead we can use a `SharedChan`, a type that allows a single
230+
`Chan` to be shared by multiple senders.
230231

231232
~~~
232233
# use std::task::spawn;
@@ -245,13 +246,16 @@ let result = port.recv() + port.recv() + port.recv();
245246
# fn some_expensive_computation(_i: uint) -> int { 42 }
246247
~~~
247248

248-
Cloning a `Chan` produces a new handle to the same channel, allowing multiple
249-
tasks to send data to a single port. It also upgrades the channel internally in
250-
order to allow this functionality, which means that channels that are not
251-
cloned can avoid the overhead required to handle multiple senders. But this
252-
fact has no bearing on the channel's usage: the upgrade is transparent.
249+
Here we transfer ownership of the channel into a new `SharedChan` value. Like
250+
`Chan`, `SharedChan` is a non-copyable, owned type (sometimes also referred to
251+
as an *affine* or *linear* type). Unlike with `Chan`, though, the programmer
252+
may duplicate a `SharedChan`, with the `clone()` method. A cloned
253+
`SharedChan` produces a new handle to the same channel, allowing multiple
254+
tasks to send data to a single port. Between `spawn`, `Chan` and
255+
`SharedChan`, we have enough tools to implement many useful concurrency
256+
patterns.
253257

254-
Note that the above cloning example is somewhat contrived since
258+
Note that the above `SharedChan` example is somewhat contrived since
255259
you could also simply use three `Chan` pairs, but it serves to
256260
illustrate the point. For reference, written with multiple streams, it
257261
might look like the example below.

branches/snap-stage3/src/doc/lib/codemirror-node.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
// Copyright (C) 2013 by Marijn Haverbeke <[email protected]> and others
2-
//
3-
// Permission is hereby granted, free of charge, to any person obtaining a copy
4-
// of this software and associated documentation files (the "Software"), to deal
5-
// in the Software without restriction, including without limitation the rights
6-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7-
// copies of the Software, and to permit persons to whom the Software is
8-
// furnished to do so, subject to the following conditions:
9-
//
10-
// The above copyright notice and this permission notice shall be included in
11-
// all copies or substantial portions of the Software.
12-
//
13-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
// THE SOFTWARE.
20-
211
exports.htmlEscape = function(text) {
222
var replacements = {"<": "&lt;", ">": "&gt;",
233
"&": "&amp;", "\"": "&quot;"};
@@ -125,8 +105,7 @@ exports.runMode = function(string, modespec, callback) {
125105
if (string == "\n")
126106
accum.push("<br>");
127107
else if (style)
128-
accum.push("<span class=\"cm-" + exports.htmlEscape(style) + "\">" +
129-
exports.htmlEscape(string) + "</span>");
108+
accum.push("<span class=\"cm-" + exports.htmlEscape(style) + "\">" + exports.htmlEscape(string) + "</span>");
130109
else
131110
accum.push(exports.htmlEscape(string));
132111
}

branches/snap-stage3/src/doc/lib/codemirror-rust.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
// Copyright (C) 2013 by Marijn Haverbeke <[email protected]> and others
2-
//
3-
// Permission is hereby granted, free of charge, to any person obtaining a copy
4-
// of this software and associated documentation files (the "Software"), to deal
5-
// in the Software without restriction, including without limitation the rights
6-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7-
// copies of the Software, and to permit persons to whom the Software is
8-
// furnished to do so, subject to the following conditions:
9-
//
10-
// The above copyright notice and this permission notice shall be included in
11-
// all copies or substantial portions of the Software.
12-
//
13-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
// THE SOFTWARE.
20-
211
CodeMirror.defineMode("rust", function() {
222
var indentUnit = 4, altIndentUnit = 2;
233
var valKeywords = {
@@ -442,8 +422,7 @@ CodeMirror.defineMode("rust", function() {
442422
type = lexical.type, closing = firstChar == type;
443423
if (type == "stat") return lexical.indented + indentUnit;
444424
if (lexical.align) return lexical.column + (closing ? 0 : 1);
445-
return lexical.indented +
446-
(closing ? 0 : (lexical.info == "match" ? altIndentUnit : indentUnit));
425+
return lexical.indented + (closing ? 0 : (lexical.info == "match" ? altIndentUnit : indentUnit));
447426
},
448427

449428
electricChars: "{}"

branches/snap-stage3/src/doc/prep.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
#!/usr/local/bin/node
22

3-
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
4-
// file at the top-level directory of this distribution and at
5-
// http://rust-lang.org/COPYRIGHT.
6-
//
7-
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8-
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10-
// option. This file may not be copied, modified, or distributed
11-
// except according to those terms.
12-
133
/***
144
* Pandoc-style markdown preprocessor that drops extra directives
155
* included for running doc code, and that optionally, when

branches/snap-stage3/src/etc/adb_run_wrapper.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2-
# file at the top-level directory of this distribution and at
3-
# http://rust-lang.org/COPYRIGHT.
4-
#
5-
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6-
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7-
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8-
# option. This file may not be copied, modified, or distributed
9-
# except according to those terms.
10-
#
11-
# ignore-tidy-linelength
121
#
132
# usage : adb_run_wrapper [test dir - where test executables exist] [test executable]
143
#

branches/snap-stage3/src/etc/check-links.pl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
#!/usr/bin/perl -w
2-
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
3-
# file at the top-level directory of this distribution and at
4-
# http://rust-lang.org/COPYRIGHT.
5-
#
6-
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7-
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8-
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9-
# option. This file may not be copied, modified, or distributed
10-
# except according to those terms.
112

123
my $file = $ARGV[0];
134

branches/snap-stage3/src/etc/cmathconsts.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2-
// file at the top-level directory of this distribution and at
3-
// http://rust-lang.org/COPYRIGHT.
4-
//
5-
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6-
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8-
// option. This file may not be copied, modified, or distributed
9-
// except according to those terms.
10-
//
11-
//
121
// This is a helper C program for generating required math constants
132
//
143
// Should only be required when porting to a different target architecture
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2-
# file at the top-level directory of this distribution and at
3-
# http://rust-lang.org/COPYRIGHT.
4-
#
5-
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6-
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7-
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8-
# option. This file may not be copied, modified, or distributed
9-
# except according to those terms.
10-
#
111
# This runs the test for emacs rust-mode.
122
# It must be possible to find emacs via PATH.
133
emacs -batch -l rust-mode.el -l rust-mode-tests.el -f ert-run-tests-batch-and-exit

branches/snap-stage3/src/etc/libc.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2-
// file at the top-level directory of this distribution and at
3-
// http://rust-lang.org/COPYRIGHT.
4-
//
5-
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6-
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8-
// option. This file may not be copied, modified, or distributed
9-
// except according to those terms.
10-
111
/*
122
* This calculates the platform-variable portion of the libc module.
133
* Move code in here only as you discover it is platform-variable.

branches/snap-stage3/src/etc/licenseck.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
"""
3434

3535
exceptions = [
36-
"doc/lib/codemirror-node.js", # MIT
37-
"doc/lib/codemirror-rust.js", # MIT
3836
"rt/rust_android_dummy.cpp", # BSD, chromium
3937
"rt/rust_android_dummy.h", # BSD, chromium
4038
"rt/isaac/randport.cpp", # public domain

branches/snap-stage3/src/etc/local_stage0.sh

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
#!/bin/sh
2-
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
3-
# file at the top-level directory of this distribution and at
4-
# http://rust-lang.org/COPYRIGHT.
5-
#
6-
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7-
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8-
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9-
# option. This file may not be copied, modified, or distributed
10-
# except according to those terms.
112

123
TARG_DIR=$1
134
PREFIX=$2
@@ -19,22 +10,22 @@ LIB_PREFIX=lib
1910
OS=`uname -s`
2011
case $OS in
2112
("Linux"|"FreeBSD")
22-
BIN_SUF=
23-
LIB_SUF=.so
24-
break
25-
;;
13+
BIN_SUF=
14+
LIB_SUF=.so
15+
break
16+
;;
2617
("Darwin")
27-
BIN_SUF=
28-
LIB_SUF=.dylib
29-
break
30-
;;
18+
BIN_SUF=
19+
LIB_SUF=.dylib
20+
break
21+
;;
3122
(*)
32-
BIN_SUF=.exe
33-
LIB_SUF=.dll
34-
LIB_DIR=bin
35-
LIB_PREFIX=
36-
break
37-
;;
23+
BIN_SUF=.exe
24+
LIB_SUF=.dll
25+
LIB_DIR=bin
26+
LIB_PREFIX=
27+
break
28+
;;
3829
esac
3930

4031
if [ -z $PREFIX ]; then

branches/snap-stage3/src/etc/mingw-fix-include/bits/c++config.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2-
// file at the top-level directory of this distribution and at
3-
// http://rust-lang.org/COPYRIGHT.
4-
//
5-
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6-
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8-
// option. This file may not be copied, modified, or distributed
9-
// except according to those terms.
10-
111
#ifndef _FIX_CXXCONFIG_H
122
#define _FIX_CXXCONFIG_H 1
133

branches/snap-stage3/src/etc/mingw-fix-include/winbase.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2-
// file at the top-level directory of this distribution and at
3-
// http://rust-lang.org/COPYRIGHT.
4-
//
5-
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6-
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8-
// option. This file may not be copied, modified, or distributed
9-
// except according to those terms.
10-
111
#ifndef _FIX_WINBASE_H
122
#define _FIX_WINBASE_H 1
133

branches/snap-stage3/src/etc/mingw-fix-include/winsock2.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2-
// file at the top-level directory of this distribution and at
3-
// http://rust-lang.org/COPYRIGHT.
4-
//
5-
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6-
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8-
// option. This file may not be copied, modified, or distributed
9-
// except according to those terms.
10-
111
#ifndef _FIX_WINSOCK2_H
122
#define _FIX_WINSOCK2_H 1
133

branches/snap-stage3/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator Cloneabl
8585
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
8686

8787
syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
88-
syn keyword rustTrait Bitwise Bounded Integer
88+
syn keyword rustTrait Bitwise Bounded Integer Fractional Real RealExt
8989
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
9090
syn keyword rustTrait Orderable Signed Unsigned Round
9191
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive

branches/snap-stage3/src/libextra/json.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn main() {
125125
}
126126
```
127127
128-
To decode a JSON string using `Decodable` trait :
128+
To decode a json string using `Decodable` trait :
129129
130130
```rust
131131
extern crate serialize;
@@ -172,7 +172,7 @@ fn main() {
172172
{data_int: 1, data_str:~"toto", data_vector:~[2,3,4,5]};
173173
let encoded_str: ~str = json::Encoder::str_encode(&to_encode_object);
174174
175-
// To deserialize use the `extra::json::from_str` and `extra::json::Decoder`
175+
// To unserialize use the `extra::json::from_str` and `extra::json::Decoder`
176176
177177
let json_object = extra::json::from_str(encoded_str);
178178
let mut decoder = json::Decoder::new(json_object.unwrap());
@@ -182,7 +182,7 @@ fn main() {
182182
183183
## Using `ToJson`
184184
185-
This example use the ToJson impl to deserialize the JSON string.
185+
This example use the ToJson impl to unserialize the json string.
186186
Example of `ToJson` trait implementation for TestStruct1.
187187
188188
```rust
@@ -212,13 +212,13 @@ impl ToJson for TestStruct1 {
212212
}
213213
214214
fn main() {
215-
// Serialization using our impl of to_json
215+
// Seralization using our impl of to_json
216216
217217
let test2: TestStruct1 = TestStruct1 {data_int: 1, data_str:~"toto", data_vector:~[2,3,4,5]};
218218
let tjson: json::Json = test2.to_json();
219219
let json_str: ~str = tjson.to_str();
220220
221-
// Deserialize like before.
221+
// Unserialize like before.
222222
223223
let mut decoder = json::Decoder::new(json::from_str(json_str).unwrap());
224224
// create the final object

branches/snap-stage3/src/libextra/test.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -904,14 +904,15 @@ pub fn run_test(force_ignore: bool,
904904
monitor_ch: Chan<MonitorMsg>,
905905
testfn: proc()) {
906906
spawn(proc() {
907+
let mut task = task::task();
907908
let (p, c) = Chan::new();
908909
let mut reader = PortReader::new(p);
909910
let stdout = ChanWriter::new(c.clone());
910911
let stderr = ChanWriter::new(c);
911-
let mut task = task::task().named(match desc.name {
912-
DynTestName(ref name) => name.clone().into_maybe_owned(),
913-
StaticTestName(name) => name.into_maybe_owned(),
914-
});
912+
match desc.name {
913+
DynTestName(ref name) => task.name(name.clone()),
914+
StaticTestName(name) => task.name(name),
915+
}
915916
task.opts.stdout = Some(~stdout as ~Writer);
916917
task.opts.stderr = Some(~stderr as ~Writer);
917918
let result_future = task.future_result();
@@ -1110,7 +1111,7 @@ impl MetricMap {
11101111
11111112
// Benchmarking
11121113
1113-
/// A function that is opaque to the optimizer, to allow benchmarks to
1114+
/// A function that is opaque to the optimiser, to allow benchmarks to
11141115
/// pretend to use outputs to assist in avoiding dead-code
11151116
/// elimination.
11161117
///

0 commit comments

Comments
 (0)