Skip to content

Commit 1c74589

Browse files
committed
---
yaml --- r: 235786 b: refs/heads/stable c: a700546 h: refs/heads/master v: v3
1 parent 3a243c0 commit 1c74589

File tree

86 files changed

+442
-2764
lines changed

Some content is hidden

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

86 files changed

+442
-2764
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: a160203e30d138944cd4b09f5a3fe6026b374dd0
32+
refs/heads/stable: a700546feabd85fa06f2bbd446865c15431c0e09
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/doc/reference.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,10 +1636,6 @@ The type of a function declared in an extern block is `extern "abi" fn(A1, ...,
16361636
An) -> R`, where `A1...An` are the declared types of its arguments and `R` is
16371637
the declared return type.
16381638

1639-
It is valid to add the `link` attribute on an empty extern block. You can use
1640-
this to satisfy the linking requirements of extern blocks elsewhere in your code
1641-
(including upstream crates) instead of adding the attribute to each extern block.
1642-
16431639
## Visibility and Privacy
16441640

16451641
These two terms are often used interchangeably, and what they are attempting to

branches/stable/src/doc/trpl/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
* [No stdlib](no-stdlib.md)
6464
* [Intrinsics](intrinsics.md)
6565
* [Lang items](lang-items.md)
66-
* [Advanced linking](advanced-linking.md)
66+
* [Link args](link-args.md)
6767
* [Benchmark Tests](benchmark-tests.md)
6868
* [Box Syntax and Patterns](box-syntax-and-patterns.md)
6969
* [Slice Patterns](slice-patterns.md)

branches/stable/src/doc/trpl/advanced-linking.md

Lines changed: 0 additions & 151 deletions
This file was deleted.

branches/stable/src/doc/trpl/ffi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ libraries:
340340
Note that frameworks are only available on OSX targets.
341341
342342
The different `kind` values are meant to differentiate how the native library
343-
participates in linkage. From a linkage perspective, the Rust compiler creates
343+
participates in linkage. From a linkage perspective, the rust compiler creates
344344
two flavors of artifacts: partial (rlib/staticlib) and final (dylib/binary).
345345
Native dynamic library and framework dependencies are propagated to the final
346346
artifact boundary, while static library dependencies are not propagated at
@@ -350,9 +350,9 @@ artifact.
350350
A few examples of how this model can be used are:
351351
352352
* A native build dependency. Sometimes some C/C++ glue is needed when writing
353-
some Rust code, but distribution of the C/C++ code in a library format is just
353+
some rust code, but distribution of the C/C++ code in a library format is just
354354
a burden. In this case, the code will be archived into `libfoo.a` and then the
355-
Rust crate would declare a dependency via `#[link(name = "foo", kind =
355+
rust crate would declare a dependency via `#[link(name = "foo", kind =
356356
"static")]`.
357357
358358
Regardless of the flavor of output for the crate, the native static library
@@ -361,7 +361,7 @@ A few examples of how this model can be used are:
361361
362362
* A normal dynamic dependency. Common system libraries (like `readline`) are
363363
available on a large number of systems, and often a static copy of these
364-
libraries cannot be found. When this dependency is included in a Rust crate,
364+
libraries cannot be found. When this dependency is included in a rust crate,
365365
partial targets (like rlibs) will not link to the library, but when the rlib
366366
is included in a final target (like a binary), the native library will be
367367
linked in.

branches/stable/src/doc/trpl/installing-rust.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The first step to using Rust is to install it! There are a number of ways to
44
install Rust, but the easiest is to use the `rustup` script. If you're on Linux
5-
or a Mac, all you need to do is this:
5+
or a Mac, all you need to do is this:
66

77
> Note: you don't need to type in the `$`s, they just indicate the start of
88
> each command. You’ll see many tutorials and examples around the web that
@@ -25,12 +25,6 @@ $ sh rustup.sh
2525
[insecurity]: http://curlpipesh.tumblr.com
2626

2727
If you're on Windows, please download the appropriate [installer][install-page].
28-
**NOTE:** By default, the Windows installer will not add Rust to the %PATH%
29-
system variable. If this is the only version of Rust you are installing and you
30-
want to be able to run it from the command line, click on "Advanced" on the
31-
install dialog and on the "Product Features" page ensure "Add to PATH" is
32-
installed on the local hard drive.
33-
3428

3529
[install-page]: http://www.rust-lang.org/install.html
3630

@@ -93,11 +87,6 @@ rustc 1.0.0 (a59de37e9 2015-05-13)
9387

9488
If you did, Rust has been installed successfully! Congrats!
9589

96-
If you didn't and you're on Windows, check that Rust is in your %PATH% system
97-
variable. If it isn't, run the installer again, select "Change" on the "Change,
98-
repair, or remove installation" page and ensure "Add to PATH" is installed on
99-
the local hard drive.
100-
10190
This installer also installs a copy of the documentation locally, so you can
10291
read it offline. On UNIX systems, `/usr/local/share/doc/rust` is the location.
10392
On Windows, it's in a `share/doc` directory, inside wherever you installed Rust
@@ -112,5 +101,5 @@ resources include [the user’s forum][users], and
112101

113102
[irc]: irc://irc.mozilla.org/#rust
114103
[mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
115-
[users]: http://users.rust-lang.org/
104+
[users]: http://users.rust-lang.org/
116105
[stackoverflow]: http://stackoverflow.com/questions/tagged/rust
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
% Link args
2+
3+
There is one other way to tell rustc how to customize linking, and that is via
4+
the `link_args` attribute. This attribute is applied to `extern` blocks and
5+
specifies raw flags which need to get passed to the linker when producing an
6+
artifact. An example usage would be:
7+
8+
``` no_run
9+
#![feature(link_args)]
10+
11+
#[link_args = "-foo -bar -baz"]
12+
extern {}
13+
# fn main() {}
14+
```
15+
16+
Note that this feature is currently hidden behind the `feature(link_args)` gate
17+
because this is not a sanctioned way of performing linking. Right now rustc
18+
shells out to the system linker, so it makes sense to provide extra command line
19+
arguments, but this will not always be the case. In the future rustc may use
20+
LLVM directly to link native libraries, in which case `link_args` will have no
21+
meaning.
22+
23+
It is highly recommended to *not* use this attribute, and rather use the more
24+
formal `#[link(...)]` attribute on `extern` blocks instead.
25+

branches/stable/src/doc/trpl/release-channels.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,3 @@ This will help alert the team in case there’s an accidental regression.
4343
Additionally, testing against nightly can catch regressions even sooner, and so
4444
if you don’t mind a third build, we’d appreciate testing against all channels.
4545

46-
As an example, many Rust programmers use [Travis](https://travis-ci.org/) to
47-
test their crates, which is free for open source projects. Travis [supports
48-
Rust directly][travis], and you can use a `.travis.yml` file like this to
49-
test on all channels:
50-
51-
```yaml
52-
language: rust
53-
rust:
54-
- nightly
55-
- beta
56-
- stable
57-
58-
matrix:
59-
allow_failures:
60-
- rust: nightly
61-
```
62-
63-
[travis]: http://docs.travis-ci.com/user/languages/rust/
64-
65-
With this configuration, Travis will test all three channels, but if something
66-
breaks on nightly, it won’t fail your build. A similar configuration is
67-
recommended for any CI system, check the documentation of the one you’re
68-
using for more details.

branches/stable/src/doc/trpl/unsafe.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,10 @@ that you normally can not do. Just three. Here they are:
100100

101101
That’s it. It’s important that `unsafe` does not, for example, ‘turn off the
102102
borrow checker’. Adding `unsafe` to some random Rust code doesn’t change its
103-
semantics, it won’t just start accepting anything. But it will let you write
104-
things that _do_ break some of the rules.
103+
semantics, it won’t just start accepting anything.
105104

106-
You will also encounter the `unsafe` keyword when writing bindings to foreign
107-
(non-Rust) interfaces. You're encouraged to write a safe, native Rust interface
108-
around the methods provided by the library.
109-
110-
Let’s go over the basic three abilities listed, in order.
105+
But it will let you write things that _do_ break some of the rules. Let’s go
106+
over these three abilities in order.
111107

112108
## Access or update a `static mut`
113109

branches/stable/src/doc/trpl/while-loops.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,6 @@ for x in 0..10 {
8888
}
8989
```
9090

91-
You may also encounter situations where you have nested loops and need to
92-
specify which one your `break` or `continue` statement is for. Like most
93-
other languages, by default a `break` or `continue` will apply to innermost
94-
loop. In a sitation where you would like to a `break` or `continue` for one
95-
of the outer loops, you can use labels to specify which loop the `break` or
96-
`continue` statement applies to. This will only print when both `x` and `y` are
97-
odd:
98-
99-
```rust
100-
'outer: for x in 0..10 {
101-
'inner: for y in 0..10 {
102-
if x % 2 == 0 { continue 'outer; } // continues the loop over x
103-
if y % 2 == 0 { continue 'inner; } // continues the loop over y
104-
println!("x: {}, y: {}", x, y);
105-
}
106-
}
107-
```
108-
10991
Both `continue` and `break` are valid in both `while` loops and [`for` loops][for].
11092

11193
[for]: for-loops.html

0 commit comments

Comments
 (0)