Skip to content

Commit 42acadb

Browse files
committed
---
yaml --- r: 211948 b: refs/heads/auto c: d6b8242 h: refs/heads/master v: v3
1 parent 5b8c4e6 commit 42acadb

File tree

3 files changed

+57
-10
lines changed

3 files changed

+57
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 17d76b350b6fc73f7ea3fee9046b74740906bf37
13+
refs/heads/auto: d6b82428b5f7ad3691adaa1c2a1ed10b2c96baa4
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/trpl/hello-cargo.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ $ mv main.rs src/main.rs
3333
```
3434

3535
Note that since we're creating an executable, we used `main.rs`. If we
36-
want to make a library instead, we should use `lib.rs`.
36+
want to make a library instead, we should use `lib.rs`. This convention is required
37+
for Cargo to successfully compile our projects, but it can be overridden if we wish.
3738
Custom file locations for the entry point can be specified
3839
with a [`[[lib]]` or `[[bin]]`][crates-custom] key in the TOML file described below.
3940

@@ -62,18 +63,17 @@ version = "0.0.1"
6263
authors = [ "Your name <[email protected]>" ]
6364
```
6465

65-
This file is in the [TOML][toml] format. Let’s let it explain itself to you:
66+
This file is in the [TOML][toml] format. TOML is similar to INI, but has some
67+
extra goodies. According to the TOML docs,
6668

6769
> TOML aims to be a minimal configuration file format that's easy to read due
6870
> to obvious semantics. TOML is designed to map unambiguously to a hash table.
6971
> TOML should be easy to parse into data structures in a wide variety of
7072
> languages.
7173
72-
TOML is very similar to INI, but with some extra goodies.
73-
7474
[toml]: https://github.com/toml-lang/toml
7575

76-
Once you have this file in place, we should be ready to build! Try this:
76+
Once you have this file in place, we should be ready to build! To do so, run:
7777

7878
```bash
7979
$ cargo build
@@ -82,7 +82,7 @@ $ ./target/debug/hello_world
8282
Hello, world!
8383
```
8484

85-
Bam! We build our project with `cargo build`, and run it with
85+
Bam! We built our project with `cargo build`, and ran it with
8686
`./target/debug/hello_world`. We can do both in one step with `cargo run`:
8787

8888
```bash
@@ -103,9 +103,9 @@ Hello, world!
103103
```
104104

105105
This hasn’t bought us a whole lot over our simple use of `rustc`, but think
106-
about the future: when our project gets more complex, we would need to do more
106+
about the future: when our project gets more complex, we need to do more
107107
things to get all of the parts to properly compile. With Cargo, as our project
108-
grows, we can just `cargo build`, and it’ll work the right way.
108+
grows, we can just run `cargo build`, and it’ll work the right way.
109109

110110
When your project is finally ready for release, you can use
111111
`cargo build --release` to compile your project with optimizations.
@@ -118,7 +118,7 @@ name = "hello_world"
118118
version = "0.0.1"
119119
```
120120

121-
This file is used by Cargo to keep track of dependencies in your application.
121+
The `Cargo.lock` file is used by Cargo to keep track of dependencies in your application.
122122
Right now, we don’t have any, so it’s a bit sparse. You won't ever need
123123
to touch this file yourself, just let Cargo handle it.
124124

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright 2015 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+
// pretty-expanded FIXME #23616
12+
13+
#![feature(collections)]
14+
15+
fn is_sync<T>(_: T) where T: Sync {}
16+
fn is_send<T>(_: T) where T: Send {}
17+
18+
macro_rules! all_sync_send {
19+
($ctor:expr, $($iter:ident),+) => ({
20+
$(
21+
let mut x = $ctor;
22+
is_sync(x.$iter());
23+
let mut y = $ctor;
24+
is_send(y.$iter());
25+
)+
26+
})
27+
}
28+
29+
fn main() {
30+
// for char.rs
31+
all_sync_send!("Я", escape_default, escape_unicode);
32+
33+
// for iter.rs
34+
// FIXME
35+
36+
// for option.rs
37+
// FIXME
38+
39+
// for result.rs
40+
// FIXME
41+
42+
// for slice.rs
43+
// FIXME
44+
45+
// for str/mod.rs
46+
// FIXME
47+
}

0 commit comments

Comments
 (0)