Skip to content

Commit fe69200

Browse files
committed
---
yaml --- r: 152982 b: refs/heads/try2 c: db29e1b h: refs/heads/master v: v3
1 parent 8ab22fa commit fe69200

File tree

448 files changed

+5794
-5388
lines changed

Some content is hidden

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

448 files changed

+5794
-5388
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: f6f1cf13d03fc3c5261fa84d08c26a386145c9ac
8+
refs/heads/try2: db29e1b9603e135948c1d77b85e2f9875270ab71
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,26 @@ documentation.
5454
When complete, `make install` will place several programs into
5555
`/usr/local/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
5656
API-documentation tool.
57-
system.
5857
3. Read the [tutorial].
5958
4. Enjoy!
6059

60+
### Building on Windows
61+
62+
To easily build on windows we can use [MSYS2](http://sourceforge.net/projects/msys2/):
63+
64+
1. Grab the latest MSYS2 installer and go through the installer.
65+
2. Now from the MSYS2 terminal we want to install the mingw64 toolchain and the other
66+
tools we need.
67+
68+
$ pacman -S mingw-w64-i686-toolchain
69+
$ pacman -S base-devel
70+
71+
3. With that now start `mingw32_shell.bat` from where you installed MSYS2 (i.e. `C:\msys`).
72+
4. From there just navigate to where you have Rust's source code, configure and build it:
73+
74+
$ ./configure --build=i686-pc-mingw32
75+
$ make && make install
76+
6177
[repo]: https://github.com/rust-lang/rust
6278
[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz
6379
[tutorial]: http://doc.rust-lang.org/tutorial.html

branches/try2/man/rustdoc.1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ directory to load plugins from (default: /tmp/rustdoc_ng/plugins)
3838
-L --library-path <val>
3939
directory to add to crate search path
4040
.TP
41+
--html-in-header <val>
42+
file to add to <head>
43+
.TP
44+
--html-before-content <val>
45+
file to add in <body>, before content
46+
.TP
47+
--html-after-content <val>
48+
file to add in <body>, after content
49+
.TP
4150
-h, --help
4251
Print help
4352

branches/try2/mk/dist.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ PKG_FILES := \
5454
driver \
5555
etc \
5656
$(foreach crate,$(CRATES),lib$(crate)) \
57+
libcoretest \
5758
libbacktrace \
5859
rt \
5960
rustllvm \

branches/try2/mk/docs.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
3535
PDF_DOCS := tutorial rust
3636

3737
RUSTDOC_DEPS_rust := doc/full-toc.inc
38-
RUSTDOC_FLAGS_rust := --markdown-in-header=doc/full-toc.inc
38+
RUSTDOC_FLAGS_rust := --html-in-header=doc/full-toc.inc
3939

4040
L10N_LANGS := ja
4141

4242
# Generally no need to edit below here.
4343

4444
# The options are passed to the documentation generators.
45-
RUSTDOC_HTML_OPTS_NO_CSS = --markdown-before-content=doc/version_info.html \
46-
--markdown-in-header=doc/favicon.inc \
47-
--markdown-after-content=doc/footer.inc \
45+
RUSTDOC_HTML_OPTS_NO_CSS = --html-before-content=doc/version_info.html \
46+
--html-in-header=doc/favicon.inc \
47+
--html-after-content=doc/footer.inc \
4848
--markdown-playground-url='http://play.rust-lang.org/'
4949

5050
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css

branches/try2/mk/tests.mk

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
######################################################################
1515

1616
# The names of crates that must be tested
17-
TEST_TARGET_CRATES = $(TARGET_CRATES)
17+
18+
# libcore tests are in a separate crate
19+
DEPS_coretest :=
20+
$(eval $(call RUST_CRATE,coretest))
21+
22+
TEST_TARGET_CRATES = $(filter-out core,$(TARGET_CRATES)) coretest
1823
TEST_DOC_CRATES = $(DOC_CRATES)
1924
TEST_HOST_CRATES = $(HOST_CRATES)
2025
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
@@ -172,7 +177,7 @@ check-notidy: cleantmptestlogs cleantestlibs all check-stage2
172177
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
173178

174179
check-lite: cleantestlibs cleantmptestlogs \
175-
$(foreach crate,$(TARGET_CRATES),check-stage2-$(crate)) \
180+
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
176181
check-stage2-rpass \
177182
check-stage2-rfail check-stage2-cfail check-stage2-rmake
178183
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log

branches/try2/src/doc/guide-unsafe.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,12 @@ impl<T: Send> Drop for Unique<T> {
267267
// A comparison between the built-in `Box` and this reimplementation
268268
fn main() {
269269
{
270-
let mut x = box 5;
270+
let mut x = box 5i;
271271
*x = 10;
272272
} // `x` is freed here
273273
274274
{
275-
let mut y = Unique::new(5);
275+
let mut y = Unique::new(5i);
276276
*y.borrow_mut() = 10;
277277
} // `y` is freed here
278278
}
@@ -678,7 +678,7 @@ unsafe fn deallocate(ptr: *mut u8, _size: uint, _align: uint) {
678678
679679
#[start]
680680
fn main(argc: int, argv: *const *const u8) -> int {
681-
let x = box 1;
681+
let x = box 1i;
682682
683683
0
684684
}

branches/try2/src/doc/guide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,9 @@ At first, your program doesn't have any dependencies, so we'll only be using
285285
the first part of its functionality. Eventually, we'll add more. Since we
286286
started off by using Cargo, it'll be easy to add later.
287287

288-
Let's convert Hello World to Cargo. The first thing we need to do is install
289-
it. To do this, we need to build it from source. There are no binaries yet.
288+
Let's convert Hello World to Cargo. The first thing we need to do to begin using Cargo
289+
is to install Cargo. To do this, we need to build it from source. There are no binaries
290+
yet.
290291

291292
First, let's go back to our projects directory. We don't want Cargo to
292293
live in our project!

branches/try2/src/doc/intro.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Check it out:
133133
```
134134
135135
fn dangling() -> Box<int> {
136-
let i = box 1234;
136+
let i = box 1234i;
137137
return i;
138138
}
139139
@@ -143,16 +143,16 @@ fn add_one() -> int {
143143
}
144144
```
145145

146-
Now instead of a stack allocated `1234`,
147-
we have a heap allocated `box 1234`.
146+
Now instead of a stack allocated `1234i`,
147+
we have a heap allocated `box 1234i`.
148148
Whereas `&` borrows a pointer to existing memory,
149149
creating an owned box allocates memory on the heap and places a value in it,
150150
giving you the sole pointer to that memory.
151151
You can roughly compare these two lines:
152152

153153
```
154154
// Rust
155-
let i = box 1234;
155+
let i = box 1234i;
156156
```
157157

158158
```cpp

branches/try2/src/doc/rust.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -442,17 +442,14 @@ of integer literal suffix:
442442
The type of an _unsuffixed_ integer literal is determined by type inference.
443443
If an integer type can be _uniquely_ determined from the surrounding program
444444
context, the unsuffixed integer literal has that type. If the program context
445-
underconstrains the type, the unsuffixed integer literal's type is `int`; if
446-
the program context overconstrains the type, it is considered a static type
447-
error.
445+
underconstrains the type, it is considered a static type error;
446+
if the program context overconstrains the type,
447+
it is also considered a static type error.
448448

449449
Examples of integer literals of various forms:
450450

451451
~~~~
452-
123; 0xff00; // type determined by program context
453-
// defaults to int in absence of type
454-
// information
455-
452+
123i; // type int
456453
123u; // type uint
457454
123_u; // type uint
458455
0xff_u8; // type u8
@@ -469,17 +466,19 @@ A _floating-point literal_ has one of two forms:
469466
second decimal literal.
470467
* A single _decimal literal_ followed by an _exponent_.
471468

472-
By default, a floating-point literal has a generic type, but will fall back to
473-
`f64`. A floating-point literal may be followed (immediately, without any
469+
By default, a floating-point literal has a generic type,
470+
and, like integer literals, the type must be uniquely determined
471+
from the context.
472+
A floating-point literal may be followed (immediately, without any
474473
spaces) by a _floating-point suffix_, which changes the type of the literal.
475474
There are two floating-point suffixes: `f32`, and `f64` (the 32-bit and 64-bit
476475
floating point types).
477476

478477
Examples of floating-point literals of various forms:
479478

480479
~~~~
481-
123.0; // type f64
482-
0.1; // type f64
480+
123.0f64; // type f64
481+
0.1f64; // type f64
483482
0.1f32; // type f32
484483
12E+99_f64; // type f64
485484
~~~~
@@ -2700,9 +2699,9 @@ must be a constant expression that can be evaluated at compile time, such
27002699
as a [literal](#literals) or a [static item](#static-items).
27012700

27022701
~~~~
2703-
[1, 2, 3, 4];
2702+
[1i, 2, 3, 4];
27042703
["a", "b", "c", "d"];
2705-
[0, ..128]; // vector with 128 zeros
2704+
[0i, ..128]; // vector with 128 zeros
27062705
[0u8, 0u8, 0u8, 0u8];
27072706
~~~~
27082707

@@ -2881,7 +2880,7 @@ equals sign (`=`) and an [rvalue](#lvalues-rvalues-and-temporaries) expression.
28812880
Evaluating an assignment expression [either copies or moves](#moved-and-copied-types) its right-hand operand to its left-hand operand.
28822881

28832882
~~~~
2884-
# let mut x = 0;
2883+
# let mut x = 0i;
28852884
# let y = 0;
28862885
28872886
x = y;
@@ -2932,7 +2931,7 @@ paren_expr : '(' expr ')' ;
29322931
An example of a parenthesized expression:
29332932

29342933
~~~~
2935-
let x = (2 + 3) * 4;
2934+
let x: int = (2 + 3) * 4;
29362935
~~~~
29372936

29382937

@@ -3016,7 +3015,7 @@ conditional expression evaluates to `false`, the `while` expression completes.
30163015
An example:
30173016

30183017
~~~~
3019-
let mut i = 0;
3018+
let mut i = 0u;
30203019
30213020
while i < 10 {
30223021
println!("hello");
@@ -3262,7 +3261,7 @@ Patterns can also dereference pointers by using the `&`,
32623261
on `x: &int` are equivalent:
32633262

32643263
~~~~
3265-
# let x = &3;
3264+
# let x = &3i;
32663265
let y = match *x { 0 => "zero", _ => "some" };
32673266
let z = match x { &0 => "zero", _ => "some" };
32683267
@@ -3285,7 +3284,7 @@ A range of values may be specified with `..`.
32853284
For example:
32863285

32873286
~~~~
3288-
# let x = 2;
3287+
# let x = 2i;
32893288
32903289
let message = match x {
32913290
0 | 1 => "not many",

branches/try2/src/doc/rustdoc.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ rustdoc can also generate JSON, for consumption by other tools, with
103103
`rustdoc --output-format json`, and also consume already-generated JSON with
104104
`rustdoc --input-format json`.
105105

106+
rustdoc also supports personalizing the output from crates' documentation,
107+
similar to markdown options.
108+
109+
- `--html-in-header FILE`: includes the contents of `FILE` at the
110+
end of the `<head>...</head>` section.
111+
- `--html-before-content FILE`: includes the contents of `FILE`
112+
directly after `<body>`, before the rendered content (including the
113+
search bar).
114+
- `--html-after-content FILE`: includes the contents of `FILE`
115+
after all the rendered content.
116+
106117
# Using the Documentation
107118

108119
The web pages generated by rustdoc present the same logical hierarchy that one
@@ -238,16 +249,16 @@ detected by a `.md` or `.markdown` extension.
238249
There are 4 options to modify the output that Rustdoc creates.
239250

240251
- `--markdown-css PATH`: adds a `<link rel="stylesheet">` tag pointing to `PATH`.
241-
- `--markdown-in-header FILE`: includes the contents of `FILE` at the
252+
- `--html-in-header FILE`: includes the contents of `FILE` at the
242253
end of the `<head>...</head>` section.
243-
- `--markdown-before-content FILE`: includes the contents of `FILE`
254+
- `--html-before-content FILE`: includes the contents of `FILE`
244255
directly after `<body>`, before the rendered content (including the
245256
title).
246-
- `--markdown-after-content FILE`: includes the contents of `FILE`
257+
- `--html-after-content FILE`: includes the contents of `FILE`
247258
directly before `</body>`, after all the rendered content.
248259

249260
All of these can be specified multiple times, and they are output in
250-
the order in which they are specified. The first line of the file must
261+
the order in which they are specified. The first line of the file being rendered must
251262
be the title, prefixed with `%` (e.g. this page has `% Rust
252263
Documentation` on the first line).
253264

0 commit comments

Comments
 (0)