Skip to content

Commit ae8cbe0

Browse files
committed
---
yaml --- r: 132448 b: refs/heads/dist-snap c: 1a80dcb h: refs/heads/master v: v3
1 parent 7f084fa commit ae8cbe0

File tree

38 files changed

+140
-329
lines changed

38 files changed

+140
-329
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 756b7b23c43cff52b1e2a89fae341c0a7389ee09
9+
refs/heads/dist-snap: 1a80dcbd56e9b7f81b7d3aa4c3809ed1859fdcf7
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/docs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ doc/$(1)/:
285285
$(2) += doc/$(1)/index.html
286286
doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET)
287287
doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
288-
@$$(call E, rustdoc: $$@)
288+
@$$(call E, rustdoc $$@)
289289
$$(Q)$$(RUSTDOC) --cfg dox --cfg stage2 $$<
290290
endef
291291

branches/dist-snap/src/compiletest/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub struct Config {
136136
// Extra parameter to run adb on arm-linux-androideabi
137137
pub adb_path: String,
138138

139-
// Extra parameter to run test suite on arm-linux-androideabi
139+
// Extra parameter to run test sute on arm-linux-androideabi
140140
pub adb_test_dir: String,
141141

142142
// status whether android device available or not

branches/dist-snap/src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
325325
let DebuggerCommands { commands, check_lines, .. } = parse_debugger_commands(testfile, "gdb");
326326
let mut cmds = commands.connect("\n");
327327

328-
// compile test file (it should have 'compile-flags:-g' in the header)
328+
// compile test file (it shoud have 'compile-flags:-g' in the header)
329329
let compiler_run_result = compile_test(config, props, testfile);
330330
if !compiler_run_result.status.success() {
331331
fatal_proc_rec("compilation failed!", &compiler_run_result);
@@ -520,7 +520,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
520520

521521
let config = &mut config;
522522

523-
// compile test file (it should have 'compile-flags:-g' in the header)
523+
// compile test file (it shoud have 'compile-flags:-g' in the header)
524524
let compile_result = compile_test(config, props, testfile);
525525
if !compile_result.status.success() {
526526
fatal_proc_rec("compilation failed!", &compile_result);

branches/dist-snap/src/doc/complement-design-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% The Rust Design FAQ
1+
% Rust Design FAQ
22

33
This document describes decisions were arrived at after lengthy discussion and
44
experimenting with alternatives. Please do not propose reversing them unless

branches/dist-snap/src/doc/complement-lang-faq.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% The Rust Language FAQ
1+
% Language FAQ
22

33
## Are there any big programs written in it yet? I want to read big samples.
44

@@ -162,15 +162,4 @@ debugging linking in the compiler you might set
162162
`RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath`
163163
For a full description see [the logging crate][1].
164164

165-
## How fast is Rust?
166-
167-
As always, this question is difficult to answer. There's still a lot of work to
168-
do on speed, and depending on what you're benchmarking, Rust has variable
169-
performance.
170-
171-
That said, it is an explicit goal of Rust to be as fast as C++ for most things.
172-
Language decisions are made with performance in mind, and we want Rust to be as
173-
fast as possible. Given that Rust is built on top of LLVM, any performance
174-
improvements in it also help us be faster.
175-
176165
[1]:log/index.html

branches/dist-snap/src/doc/complement-project-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% The Rust Project FAQ
1+
% Project FAQ
22

33
# What is this project's goal, in one sentence?
44

branches/dist-snap/src/doc/guide-strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% The Guide to Rust Strings
1+
% The Strings Guide
22

33
Strings are an important concept to master in any programming language. If you
44
come from a managed language background, you may be surprised at the complexity

branches/dist-snap/src/doc/guide-unsafe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Writing Unsafe and Low-Level Code in Rust
1+
% Writing Safe Unsafe and Low-Level Code
22

33
# Introduction
44

branches/dist-snap/src/doc/guide.md

Lines changed: 36 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Now that you've got your file open, type this in:
152152

153153
```
154154
fn main() {
155-
println!("Hello, world!");
155+
println!("Hello, world");
156156
}
157157
```
158158

@@ -161,7 +161,7 @@ Save the file, and then type this into your terminal window:
161161
```{bash}
162162
$ rustc hello_world.rs
163163
$ ./hello_world # or hello_world.exe on Windows
164-
Hello, world!
164+
Hello, world
165165
```
166166

167167
Success! Let's go over what just happened in detail.
@@ -187,7 +187,7 @@ declaration, with one space in between.
187187
Next up is this line:
188188

189189
```
190-
println!("Hello, world!");
190+
println!("Hello, world");
191191
```
192192

193193
This line does all of the work in our little program. There are a number of
@@ -205,7 +205,7 @@ to mention: Rust's macros are significantly different than C macros, if you've
205205
used those. Don't be scared of using macros. We'll get to the details
206206
eventually, you'll just have to trust us for now.
207207

208-
Next, `"Hello, world!"` is a **string**. Strings are a surprisingly complicated
208+
Next, `"Hello, world"` is a **string**. Strings are a surprisingly complicated
209209
topic in a systems programming language, and this is a **statically allocated**
210210
string. We will talk more about different kinds of allocation later. We pass
211211
this string as an argument to `println!`, which prints the string to the
@@ -316,7 +316,7 @@ Put this inside:
316316
317317
name = "hello_world"
318318
version = "0.1.0"
319-
authors = [ "someone@example.com" ]
319+
authors = [ "Your name <you@example.com>" ]
320320
321321
[[bin]]
322322
@@ -449,9 +449,9 @@ let x;
449449
...we'll get an error:
450450

451451
```{ignore}
452-
src/hello_world.rs:2:9: 2:10 error: cannot determine a type for this local variable: unconstrained type
453-
src/hello_world.rs:2 let x;
454-
^
452+
src/guessing_game.rs:2:9: 2:10 error: cannot determine a type for this local variable: unconstrained type
453+
src/guessing_game.rs:2 let x;
454+
^
455455
```
456456

457457
Giving it a type will compile, though:
@@ -460,7 +460,7 @@ Giving it a type will compile, though:
460460
let x: int;
461461
```
462462

463-
Let's try it out. Change your `src/hello_world.rs` file to look like this:
463+
Let's try it out. Change your `src/guessing_game.rs` file to look like this:
464464

465465
```{rust}
466466
fn main() {
@@ -474,10 +474,10 @@ You can use `cargo build` on the command line to build it. You'll get a warning,
474474
but it will still print "Hello, world!":
475475

476476
```{ignore,notrust}
477-
Compiling hello_world v0.1.0 (file:/home/you/projects/hello_world)
478-
src/hello_world.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variable)] on by default
479-
src/hello_world.rs:2 let x: int;
480-
^
477+
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
478+
src/guessing_game.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variable)] on by default
479+
src/guessing_game.rs:2 let x: int;
480+
^
481481
```
482482

483483
Rust warns us that we never use the variable binding, but since we never use it,
@@ -496,16 +496,16 @@ And try to build it. You'll get an error:
496496

497497
```{bash}
498498
$ cargo build
499-
Compiling hello_world v0.1.0 (file:/home/you/projects/hello_world)
500-
src/hello_world.rs:4:39: 4:40 error: use of possibly uninitialized variable: `x`
501-
src/hello_world.rs:4 println!("The value of x is: {}", x);
502-
^
499+
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
500+
src/guessing_game.rs:4:39: 4:40 error: use of possibly uninitialized variable: `x`
501+
src/guessing_game.rs:4 println!("The value of x is: {}", x);
502+
^
503503
note: in expansion of format_args!
504504
<std macros>:2:23: 2:77 note: expansion site
505505
<std macros>:1:1: 3:2 note: in expansion of println!
506-
src/hello_world.rs:4:5: 4:42 note: expansion site
506+
src/guessing_game.rs:4:5: 4:42 note: expansion site
507507
error: aborting due to previous error
508-
Could not execute process `rustc src/hello_world.rs --crate-type bin --out-dir /home/you/projects/hello_world/target -L /home/you/projects/hello_world/target -L /home/you/projects/hello_world/target/deps` (status=101)
508+
Could not execute process `rustc src/guessing_game.rs --crate-type bin --out-dir /home/you/projects/guessing_game/target -L /home/you/projects/guessing_game/target -L /home/you/projects/guessing_game/target/deps` (status=101)
509509
```
510510

511511
Rust will not let us use a value that has not been initialized. So why let us
@@ -1594,41 +1594,45 @@ taken to the screen. Sound good?
15941594

15951595
## Set up
15961596

1597-
Let's set up a new project. Go to your projects directory, and make a new
1598-
directory for the project, as well as a `src` directory for our code:
1597+
Let's set up a new project. Go to your projects directory. Remember how we
1598+
had to create our directory structure and a `Cargo.toml` for `hello_world`? Cargo
1599+
has a command that does that for us. Let's give it a shot:
15991600

16001601
```{bash}
16011602
$ cd ~/projects
1602-
$ mkdir guessing_game
1603+
$ cargo new guessing_game --bin
16031604
$ cd guessing_game
1604-
$ mkdir src
16051605
```
16061606

1607-
Great. Next, let's make a `Cargo.toml` file so Cargo knows how to build our
1608-
project:
1607+
We pass the name of our project to `cargo new`, and then the `--bin` flag,
1608+
since we're making a binary, rather than a library.
1609+
1610+
Check out the generated `Cargo.toml`:
16091611

16101612
```{ignore}
16111613
[package]
16121614
16131615
name = "guessing_game"
16141616
version = "0.1.0"
1615-
authors = [ "someone@example.com" ]
1617+
authors = ["Your Name <you@example.com>"]
16161618
16171619
[[bin]]
16181620
16191621
name = "guessing_game"
16201622
```
16211623

1622-
Finally, we need our source file. Let's just make it hello world for now, so we
1623-
can check that our setup works. In `src/guessing_game.rs`:
1624+
Cargo gets this information from your environment. If it's not correct, go ahead
1625+
and fix that.
1626+
1627+
Finally, Cargo generated a hello, world for us. Check out `src/main.rs`:
16241628

16251629
```{rust}
16261630
fn main() {
16271631
println!("Hello world!");
16281632
}
16291633
```
16301634

1631-
Let's make sure that worked:
1635+
Let's try compiling what Cargo gave us:
16321636

16331637
```{bash}
16341638
$ cargo build
@@ -1883,7 +1887,6 @@ fn cmp(a: int, b: int) -> Ordering {
18831887
If we try to compile, we'll get some errors:
18841888

18851889
```{notrust,ignore}
1886-
$ cargo build
18871890
$ cargo build
18881891
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
18891892
src/guessing_game.rs:20:15: 20:20 error: mismatched types: expected `int` but found `collections::string::String` (expected int but found struct collections::string::String)
@@ -2486,27 +2489,7 @@ Enough talk, let's build something! Let's make a new project called `modules`.
24862489

24872490
```{bash,ignore}
24882491
$ cd ~/projects
2489-
$ mkdir modules
2490-
$ cd modules
2491-
$ mkdir src
2492-
```
2493-
2494-
We need to make our two 'hello world' files. In `src/main.rs`:
2495-
2496-
```{rust}
2497-
fn main() {
2498-
println!("Hello, world!");
2499-
}
2500-
```
2501-
2502-
And in `Cargo.toml`:
2503-
2504-
```{notrust,ignore}
2505-
[package]
2506-
2507-
name = "modules"
2508-
version = "0.1.0"
2509-
authors = [ "[email protected]" ]
2492+
$ cargo new modules --bin
25102493
```
25112494

25122495
Let's double check our work by compiling:
@@ -2924,34 +2907,16 @@ now: make a new project:
29242907

29252908
```{bash,ignore}
29262909
$ cd ~/projects
2927-
$ mkdir testing
2910+
$ cargo new testing --bin
29282911
$ cd testing
2929-
$ mkdir test
2930-
```
2931-
2932-
In `src/main.rs`:
2933-
2934-
```{rust}
2935-
fn main() {
2936-
println!("Hello, world!");
2937-
}
2938-
```
2939-
2940-
And in `Cargo.toml`:
2941-
2942-
```{notrust,ignore}
2943-
[package]
2944-
2945-
name = "testing"
2946-
version = "0.1.0"
2947-
authors = [ "[email protected]" ]
29482912
```
29492913

29502914
And try it out:
29512915

29522916
```{notrust,ignore}
29532917
$ cargo run
29542918
Compiling testing v0.1.0 (file:/home/you/projects/testing)
2919+
Running `target/testing`
29552920
Hello, world!
29562921
$
29572922
```

branches/dist-snap/src/doc/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Rust Documentation
1+
% Rust documentation
22

33
<!-- Completely hide the TOC and the section numbers -->
44
<style type="text/css">
@@ -19,7 +19,7 @@ li {list-style-type: none; }
1919
* [Containers and Iterators](guide-container.html)
2020
* [Tasks and Communication](guide-tasks.html)
2121
* [Foreign Function Interface](guide-ffi.html)
22-
* [Writing Unsafe and Low-Level Code](guide-unsafe.html)
22+
* [Writing Safe Unsafe and Low-Level Code](guide-unsafe.html)
2323
* [Macros](guide-macros.html)
2424
* [Testing](guide-testing.html)
2525
* [Rust's Runtime](guide-runtime.html)

branches/dist-snap/src/doc/rust.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,13 @@ table th {
324324

325325
.rusttest { display: none; }
326326
pre.rust { position: relative; }
327+
pre.rust a { transform: scaleX(-1); }
327328
.test-arrow {
328329
display: inline-block;
329330
position: absolute;
330331
top: 0;
331332
right: 10px;
332333
font-size: 150%;
333-
-webkit-transform: scaleX(-1);
334-
transform: scaleX(-1);
335334
}
336335

337336
@media (min-width: 1170px) {

0 commit comments

Comments
 (0)