Skip to content

Commit 80390b1

Browse files
committed
---
yaml --- r: 142734 b: refs/heads/try2 c: 278ed50 h: refs/heads/master v: v3
1 parent 567202f commit 80390b1

File tree

137 files changed

+7872
-2668
lines changed

Some content is hidden

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

137 files changed

+7872
-2668
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: 3b8c5a1a3772a5c4d64d202db8b0af94651b08ff
8+
refs/heads/try2: 278ed50e0a66f4c549e43c82e4a545890091e9ba
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: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,39 @@ LIBRUST_DSYM_GLOB_$(1) :=$(call CFG_LIB_DSYM_GLOB_$(1),rust)
235235

236236
endef
237237

238+
# $(1) is the path for directory to match against
239+
# $(2) is the glob to use in the match
240+
# $(3) is filename (usually the target being created) to filter out from match
241+
# (i.e. filename is not out-of-date artifact from prior Rust version/build)
242+
#
243+
# Note that a common bug is to accidentally construct the glob denoted
244+
# by $(2) with a space character prefix, which invalidates the
245+
# construction $(1)$(2).
246+
define CHECK_FOR_OLD_GLOB_MATCHES_EXCEPT
247+
$(Q)MATCHES="$(filter-out %$(3),$(wildcard $(1)/$(2)))"; if [ -n "$$MATCHES" ] ; then echo "Warning: there are previous" \'$(2)\' "libraries:" $$MATCHES; fi
248+
endef
249+
250+
# Same interface as above, but deletes rather than just listing the files.
251+
define REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT
252+
$(Q)MATCHES="$(filter-out %$(3),$(wildcard $(1)/$(2)))"; if [ -n "$$MATCHES" ] ; then echo "Warning: removing previous" \'$(2)\' "libraries:" $$MATCHES; rm -v $$MATCHES ; fi
253+
endef
254+
255+
# We use a different strategy for LIST_ALL_OLD_GLOB_MATCHES_EXCEPT
256+
# than in the macros above because it needs the result of running the
257+
# `ls` command after other rules in the command list have run; the
258+
# macro-expander for $(wildcard ...) would deliver its results too
259+
# soon. (This is in contrast to the macros above, which are meant to
260+
# be run at the outset of a command list in a rule.)
261+
ifdef VERBOSE
262+
define LIST_ALL_OLD_GLOB_MATCHES_EXCEPT
263+
@echo "Info: now are following matches for" '$(2)' "libraries:"
264+
@( cd $(1) && ( ls $(2) 2>/dev/null || true ) | grep -v $(3) || true )
265+
endef
266+
else
267+
define LIST_ALL_OLD_GLOB_MATCHES_EXCEPT
268+
endef
269+
endif
270+
238271
$(foreach target,$(CFG_TARGET_TRIPLES),\
239272
$(eval $(call DEF_LIBS,$(target))))
240273

branches/try2/doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,11 @@ Use declarations support a number of convenient shortcuts:
802802
An example of `use` declarations:
803803

804804
~~~~
805-
use std::float::sin;
805+
use std::num::sin;
806806
use std::option::{Some, None};
807807
808808
fn main() {
809-
// Equivalent to 'info!(std::float::sin(1.0));'
809+
// Equivalent to 'info!(std::num::sin(1.0));'
810810
info!(sin(1.0));
811811
812812
// Equivalent to 'info!(~[std::option::Some(1.0), std::option::None]);'

branches/try2/doc/tutorial.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,13 @@ types.
503503
504504
~~~~
505505
# use std::float;
506+
# use std::num::atan;
506507
fn angle(vector: (float, float)) -> float {
507508
let pi = float::consts::pi;
508509
match vector {
509510
(0f, y) if y < 0f => 1.5 * pi,
510511
(0f, y) => 0.5 * pi,
511-
(x, y) => float::atan(y / x)
512+
(x, y) => atan(y / x)
512513
}
513514
}
514515
~~~~
@@ -1728,10 +1729,9 @@ To call such a method, just prefix it with the type name and a double colon:
17281729

17291730
~~~~
17301731
# use std::float::consts::pi;
1731-
# use std::float::sqrt;
17321732
struct Circle { radius: float }
17331733
impl Circle {
1734-
fn new(area: float) -> Circle { Circle { radius: sqrt(area / pi) } }
1734+
fn new(area: float) -> Circle { Circle { radius: (area / pi).sqrt() } }
17351735
}
17361736
let c = Circle::new(42.5);
17371737
~~~~
@@ -1997,16 +1997,15 @@ implementation to use.
19971997

19981998
~~~~
19991999
# use std::float::consts::pi;
2000-
# use std::float::sqrt;
20012000
trait Shape { fn new(area: float) -> Self; }
20022001
struct Circle { radius: float }
20032002
struct Square { length: float }
20042003
20052004
impl Shape for Circle {
2006-
fn new(area: float) -> Circle { Circle { radius: sqrt(area / pi) } }
2005+
fn new(area: float) -> Circle { Circle { radius: (area / pi).sqrt() } }
20072006
}
20082007
impl Shape for Square {
2009-
fn new(area: float) -> Square { Square { length: sqrt(area) } }
2008+
fn new(area: float) -> Square { Square { length: (area).sqrt() } }
20102009
}
20112010
20122011
let area = 42.5;
@@ -2154,14 +2153,13 @@ Now, we can implement `Circle` on a type only if we also implement `Shape`.
21542153

21552154
~~~~
21562155
# use std::float::consts::pi;
2157-
# use std::float::sqrt;
21582156
# trait Shape { fn area(&self) -> float; }
21592157
# trait Circle : Shape { fn radius(&self) -> float; }
21602158
# struct Point { x: float, y: float }
21612159
# fn square(x: float) -> float { x * x }
21622160
struct CircleStruct { center: Point, radius: float }
21632161
impl Circle for CircleStruct {
2164-
fn radius(&self) -> float { sqrt(self.area() / pi) }
2162+
fn radius(&self) -> float { (self.area() / pi).sqrt() }
21652163
}
21662164
impl Shape for CircleStruct {
21672165
fn area(&self) -> float { pi * square(self.radius) }
@@ -2190,12 +2188,11 @@ Likewise, supertrait methods may also be called on trait objects.
21902188

21912189
~~~ {.xfail-test}
21922190
# use std::float::consts::pi;
2193-
# use std::float::sqrt;
21942191
# trait Shape { fn area(&self) -> float; }
21952192
# trait Circle : Shape { fn radius(&self) -> float; }
21962193
# struct Point { x: float, y: float }
21972194
# struct CircleStruct { center: Point, radius: float }
2198-
# impl Circle for CircleStruct { fn radius(&self) -> float { sqrt(self.area() / pi) } }
2195+
# impl Circle for CircleStruct { fn radius(&self) -> float { (self.area() / pi).sqrt() } }
21992196
# impl Shape for CircleStruct { fn area(&self) -> float { pi * square(self.radius) } }
22002197
22012198
let concrete = @CircleStruct{center:Point{x:3f,y:4f},radius:5f};

branches/try2/man/rust.1

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
.TH RUST "1" "July 2013" "rust 0.7" "User Commands"
2+
.SH NAME
3+
rust \- a front-end to the Rust toolchain
4+
.SH SYNOPSIS
5+
.B rust
6+
[\fICOMMAND\fR] [\fIOPTIONS\fR] \fIINPUT\fR
7+
8+
.SH DESCRIPTION
9+
This tool is a front-end for the Rust language, available at
10+
<\fBhttps://www.rust-lang.org\fR>. It provides commands to
11+
run, test and package Rust programs.
12+
13+
.SH COMMANDS
14+
15+
.TP
16+
\fBbuild\fR
17+
compile rust source files
18+
.TP
19+
\fBrun\fR
20+
build an executable, and run it
21+
.TP
22+
\fBtest\fR
23+
build a test executable, and run it
24+
.TP
25+
\fBdoc\fR
26+
generate documentation from doc comments
27+
.TP
28+
\fBpkg\fR
29+
download, build, install rust packages
30+
.TP
31+
\fBsketch\fR
32+
run a rust interpreter
33+
.TP
34+
\fBhelp\fR
35+
show detailed usage of a command
36+
37+
The build, run and test commands take the same parameters
38+
as the rustc command.
39+
40+
.SS "BUILD COMMAND"
41+
42+
The \fBbuild\fR command is a shortcut for the \fBrustc\fR command line.
43+
All options will be passed to the compiler verbatim. For example, to build
44+
an optimised version:
45+
46+
$ rust build -O <filename>
47+
48+
.SS "RUN COMMAND"
49+
50+
The \fBrun\fR command is a shortcut for the \fBrustc\fR command line.
51+
All options will be passed to the compiler verbatim, and if the compilation
52+
is successful, the resultant executable will be invoked. For example, to
53+
build and run an optimised version:
54+
55+
$ rust run -O <filename>
56+
57+
.SS "TEST COMMAND"
58+
59+
The \fBtest\fR command is a shortcut for the command line:
60+
61+
$ rustc --test <filename> -o <filestem>test~ && ./<filestem>test~
62+
63+
.SS "DOC COMMAND"
64+
65+
The \fBdoc\fR command is an alias for the rustdoc program. It is equivalent to:
66+
67+
$ rustdoc [options] <cratefile>
68+
69+
.SS "PKG COMMAND"
70+
71+
The \fBpkg\fR command is an alias for the rustpkg program. It is equivalent to:
72+
73+
$ rustpkg [options] <cratefile>
74+
75+
.SS "SKETCH COMMAND"
76+
77+
The \fBsketch\fR command launches the \fBrusti\fR interactive shell.
78+
79+
.SS "HELP COMMAND"
80+
81+
The \fBhelp\fR command displays a summary of available commands (ie. this text).
82+
83+
.SH "EXAMPLES"
84+
85+
To build an executable (with a main function):
86+
$ rust build hello.rs
87+
88+
To build a library from a source file:
89+
$ rust build --lib hello-lib.rs
90+
91+
To build and run an executable:
92+
$ rust run hello.rs
93+
94+
To build an executable with unit tests and execute the tests:
95+
$ rust test hello.rs
96+
97+
To create a package
98+
99+
.SH "SEE ALSO"
100+
rustc, rustdoc, rustpkg, rusti
101+
102+
.SH "BUGS"
103+
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
104+
105+
.SH "AUTHOR"
106+
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
107+
<\fI[email protected]\fR> is the project leader.
108+
109+
.SH "COPYRIGHT"
110+
This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR
111+
file in the rust source distribution.

branches/try2/man/rustc.1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ Build a test harness
8686
\fB\-\-target\fR TRIPLE
8787
Target triple cpu-manufacturer-kernel[-os] to compile for (see
8888
http://sources.redhat.com/autobook/autobook/autobook_17.html
89-
for detail)
89+
for details)
9090
.TP
9191
\fB\-\-target-feature\fR TRIPLE
92-
Target-specific attributes (see llc -mattr=help for detail)
92+
Target-specific attributes (see llc -mattr=help for details)
9393
.TP
9494
\fB\-\-android-cross-path\fR PATH
9595
The path to the Android NDK
@@ -128,6 +128,9 @@ To build either with a crate (.rc) file:
128128
To build an executable with debug info (experimental):
129129
$ rustc -Z debug-info -o hello hello.rs
130130

131+
.SH "SEE ALSO"
132+
133+
rust, rustdoc, rustpkg, rusti
131134

132135
.SH "BUGS"
133136
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.

branches/try2/man/rustdoc.1

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.TH RUSTDOC "1" "July 2013" "rustdoc 0.7" "User Commands"
2+
.SH NAME
3+
rustdoc \- generate documentation from Rust source code
4+
.SH SYNOPSIS
5+
.B rustdoc
6+
[\fIOPTIONS\fR] \fICRATEFILE\fR
7+
8+
.SH DESCRIPTION
9+
This tool generates API reference documentation by extracting comments from
10+
source code written in the Rust language, available at <\fBhttps://www.rust-
11+
lang.org\fR>. It provides several output formats for the generated
12+
documentation.
13+
14+
.SH COMMANDS
15+
16+
.TP
17+
--output-dir <val>
18+
Put documents here (default: .)
19+
.TP
20+
--output-format <val>
21+
markdown or html (default: html)
22+
.TP
23+
--output-style <val>
24+
doc-per-crate or doc-per-mod (default: doc-per-mod)
25+
.TP
26+
--pandoc-cmd <val>
27+
Command for running pandoc
28+
.TP
29+
-h, --help
30+
Print help
31+
32+
.SH "OUTPUT FORMATS"
33+
34+
The rustdoc tool can generate documentation in either the Markdown
35+
or HTML formats. It requires the pandoc tool
36+
<\fBhttp://johnmacfarlane.net/pandoc/\fR> for conversion features.
37+
38+
.SH "EXAMPLES"
39+
40+
To generate documentation for the source in the current directory:
41+
$ rustdoc hello.rs
42+
43+
To build documentation into a subdirectory named 'doc' in the Markdown
44+
format:
45+
$ rustdoc --output-dir doc --output-format markdown hello.rs
46+
47+
The generated HTML can be viewed with any standard web browser, while
48+
the Markdown version is well-suited for conversion into other formats.
49+
50+
.SH "SEE ALSO"
51+
52+
rust, rustc, rustpkg, rusti
53+
54+
.SH "BUGS"
55+
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
56+
57+
.SH "AUTHOR"
58+
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
59+
<\fI[email protected]\fR> is the project leader.
60+
61+
.SH "COPYRIGHT"
62+
This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR
63+
file in the rust source distribution.

0 commit comments

Comments
 (0)