Skip to content

Commit 071190e

Browse files
committed
---
yaml --- r: 149373 b: refs/heads/try2 c: 418eea1 h: refs/heads/master i: 149371: 5820684 v: v3
1 parent 48df384 commit 071190e

Some content is hidden

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

95 files changed

+1118
-3157
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: 209b47f248ba98fce70210dede3f99cf0313d357
8+
refs/heads/try2: 418eea115454f1a617440e9e35f9c63520962bc3
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@
1919
#
2020
# First, start with one of these build targets:
2121
#
22-
# * all - The default. Build a complete, bootstrapped compiler.
22+
# * all - The default. Builds a complete, bootstrapped compiler.
2323
# `rustc` will be in `${target-triple}/stage2/bin/`. Run it
2424
# directly from the build directory if you like. This also
2525
# comes with docs in `doc/`.
2626
#
2727
# * check - Run the complete test suite
2828
#
29-
# * clean - Clean the build repertory. It is advised to run this
30-
# command if you want to build Rust again, after an update
31-
# of the git repository.
32-
#
3329
# * install - Install Rust. Note that installation is not necessary
3430
# to use the compiler.
3531
#
@@ -107,7 +103,7 @@
107103
#
108104
# </tips>
109105
#
110-
# <nitty-gritty>
106+
# <nittygritty>
111107
#
112108
# # The Rust Build System
113109
#
@@ -156,12 +152,12 @@
156152
# libraries are managed and versioned without polluting the common
157153
# areas of the filesystem.
158154
#
159-
# General rust binaries may still live in the host bin directory; they
155+
# General rust binaries may stil live in the host bin directory; they
160156
# will just link against the libraries in the target lib directory.
161157
#
162158
# Admittedly this is a little convoluted.
163159
#
164-
# </nitty-gritty>
160+
# </nittygritty>
165161
#
166162

167163
######################################################################

branches/try2/mk/main.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,13 @@ all: $(ALL_TARGET_RULES) $(GENERATED) docs
446446
# $(1) is the name of the doc <section> in Makefile.in
447447
# pick everything between tags | remove first line | remove last line
448448
# | remove extra (?) line | strip leading `#` from lines
449-
SHOW_DOCS = $(Q)awk '/<$(1)>/,/<\/$(1)>/' $(S)/Makefile.in | sed '1d' | sed '$$d' | sed 's/^\# \?//'
449+
SHOW_DOCS = $(Q)awk '/$(1)/,/<\/$(1)>/' $(S)/Makefile.in | sed '1d' | sed '$$d' | sed 's/^\# \?//'
450450

451451
help:
452452
$(call SHOW_DOCS,help)
453453

454-
tips:
455-
$(call SHOW_DOCS,tips)
454+
hot-tips:
455+
$(call SHOW_DOCS,hottips)
456456

457457
nitty-gritty:
458-
$(call SHOW_DOCS,nitty-gritty)
458+
$(call SHOW_DOCS,nittygritty)

branches/try2/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/try2/src/compiler-rt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit f4b221571ce6f05714c1f1c6fa48f1393499989c
1+
Subproject commit d4606f1818dd8dfeaa3e509cd1cbac4482c3513e

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

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,24 +1750,6 @@ closures, but they also own them: that is, no other code can access
17501750
them. Owned closures are used in concurrent code, particularly
17511751
for spawning [tasks][tasks].
17521752
1753-
Closures can be used to spawn tasks.
1754-
A practical example of this pattern is found when using the `spawn` function,
1755-
which starts a new task.
1756-
1757-
~~~~
1758-
use std::task::spawn;
1759-
1760-
// proc is the closure which will be spawned.
1761-
spawn(proc() {
1762-
debug!("I'm a new task")
1763-
});
1764-
~~~~
1765-
1766-
> ***Note:*** If you want to see the output of `debug!` statements, you will need to turn on
1767-
> `debug!` logging. To enable `debug!` logging, set the RUST_LOG environment
1768-
> variable to the name of your crate, which, for a file named `foo.rs`, will be
1769-
> `foo` (e.g., with bash, `export RUST_LOG=foo`).
1770-
17711753
## Closure compatibility
17721754
17731755
Rust closures have a convenient subtyping property: you can pass any kind of
@@ -1789,6 +1771,45 @@ call_twice(function);
17891771
> in small ways. At the moment they can be unsound in some
17901772
> scenarios, particularly with non-copyable types.
17911773
1774+
## Do syntax
1775+
1776+
The `do` expression makes it easier to call functions that take procedures
1777+
as arguments.
1778+
1779+
Consider this function that takes a procedure:
1780+
1781+
~~~~
1782+
fn call_it(op: proc(v: int)) {
1783+
op(10)
1784+
}
1785+
~~~~
1786+
1787+
As a caller, if we use a closure to provide the final operator
1788+
argument, we can write it in a way that has a pleasant, block-like
1789+
structure.
1790+
1791+
~~~~
1792+
# fn call_it(op: proc(v: int)) { }
1793+
call_it(proc(n) {
1794+
println!("{}", n);
1795+
});
1796+
~~~~
1797+
1798+
A practical example of this pattern is found when using the `spawn` function,
1799+
which starts a new task.
1800+
1801+
~~~~
1802+
use std::task::spawn;
1803+
spawn(proc() {
1804+
debug!("I'm a new task")
1805+
});
1806+
~~~~
1807+
1808+
If you want to see the output of `debug!` statements, you will need to turn on
1809+
`debug!` logging. To enable `debug!` logging, set the RUST_LOG environment
1810+
variable to the name of your crate, which, for a file named `foo.rs`, will be
1811+
`foo` (e.g., with bash, `export RUST_LOG=foo`).
1812+
17921813
# Methods
17931814
17941815
Methods are like functions except that they always begin with a special argument,

branches/try2/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/try2/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/try2/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/try2/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/try2/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

0 commit comments

Comments
 (0)