Skip to content

Commit f1bb6c2

Browse files
committed
Auto merge of rust-lang#22397 - Manishearth:rollup, r=huonw
None
2 parents 22224ca + 35ee895 commit f1bb6c2

Some content is hidden

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

72 files changed

+1189
-426
lines changed

mk/docs.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,21 +129,21 @@ doc/:
129129
HTML_DEPS += doc/rust.css
130130
doc/rust.css: $(D)/rust.css | doc/
131131
@$(call E, cp: $@)
132-
$(Q)cp -a $< $@ 2> /dev/null
132+
$(Q)cp -PRp $< $@ 2> /dev/null
133133

134134
HTML_DEPS += doc/favicon.inc
135135
doc/favicon.inc: $(D)/favicon.inc | doc/
136136
@$(call E, cp: $@)
137-
$(Q)cp -a $< $@ 2> /dev/null
137+
$(Q)cp -PRp $< $@ 2> /dev/null
138138

139139
doc/full-toc.inc: $(D)/full-toc.inc | doc/
140140
@$(call E, cp: $@)
141-
$(Q)cp -a $< $@ 2> /dev/null
141+
$(Q)cp -PRp $< $@ 2> /dev/null
142142

143143
HTML_DEPS += doc/footer.inc
144144
doc/footer.inc: $(D)/footer.inc | doc/
145145
@$(call E, cp: $@)
146-
$(Q)cp -a $< $@ 2> /dev/null
146+
$(Q)cp -PRp $< $@ 2> /dev/null
147147

148148
# The (english) documentation for each doc item.
149149

mk/tests.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ ifdef CHECK_IGNORED
3838
TESTARGS += --ignored
3939
endif
4040

41-
4241
# Arguments to the cfail/rfail/rpass/bench tests
4342
ifdef CFG_VALGRIND
4443
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
4544
endif
4645

47-
ifdef PLEASE_BENCH
48-
TESTARGS += --bench
49-
endif
50-
5146
# Arguments to the perf tests
5247
ifdef CFG_PERF_TOOL
5348
CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
5449
endif
5550

5651
CTEST_TESTARGS := $(TESTARGS)
5752

53+
# --bench is only relevant for crate tests, not for the compile tests
54+
ifdef PLEASE_BENCH
55+
TESTARGS += --bench
56+
endif
57+
5858
ifdef VERBOSE
5959
CTEST_TESTARGS += --verbose
6060
endif

src/doc/reference.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ All of the above extensions are expressions with values.
648648

649649
Users of `rustc` can define new syntax extensions in two ways:
650650

651-
* [Compiler plugins](book/syntax-extensions.html) can include arbitrary
651+
* [Compiler plugins][plugin] can include arbitrary
652652
Rust code that manipulates syntax trees at compile time.
653653

654654
* [Macros](book/macros.html) define new syntax in a higher-level,
@@ -818,9 +818,8 @@ item : extern_crate_decl | use_decl | mod_item | fn_item | type_item
818818
| extern_block ;
819819
```
820820

821-
An _item_ is a component of a crate; some module items can be defined in crate
822-
files, but most are defined in source files. Items are organized within a crate
823-
by a nested set of [modules](#modules). Every crate has a single "outermost"
821+
An _item_ is a component of a crate. Items are organized within a crate by a
822+
nested set of [modules](#modules). Every crate has a single "outermost"
824823
anonymous module; all further items within the crate have [paths](#paths)
825824
within the module tree of the crate.
826825

src/doc/trpl/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@
3737
* [Macros](macros.md)
3838
* [Compiler Plugins](plugins.md)
3939
* [Conclusion](conclusion.md)
40+
* [Glossary](glossary.md)

src/doc/trpl/compound-data-types.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ This pattern is very powerful, and we'll see it repeated more later.
4747

4848
There are also a few things you can do with a tuple as a whole, without
4949
destructuring. You can assign one tuple into another, if they have the same
50-
arity and contained types.
50+
contained types and arity. Tuples have the same arity when they have the same
51+
length.
5152

5253
```rust
5354
let mut x = (1, 2); // x: (i32, i32)

src/doc/trpl/glossary.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
% Glossary
2+
3+
Not every Rustacean has a background in systems programming, nor in computer
4+
science, so we've added explanations of terms that might be unfamiliar.
5+
6+
### Arity
7+
8+
Arity refers to the number of arguments a function or operation takes.
9+
10+
```rust
11+
let x = (2, 3);
12+
let y = (4, 6);
13+
let z = (8, 2, 6);
14+
```
15+
16+
In the example above `x` and `y` have arity 2. `z` has arity 3.

src/doc/trpl/hello-world.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ This line does all of the work in our little program. There are a number of
8989
details that are important here. The first is that it's indented with four
9090
spaces, not tabs. Please configure your editor of choice to insert four spaces
9191
with the tab key. We provide some [sample configurations for various
92-
editors](https://github.com/rust-lang/rust/tree/master/src/etc).
92+
editors](https://github.com/rust-lang/rust/tree/master/src/etc/CONFIGS.md).
9393

9494
The second point is the `println!()` part. This is calling a Rust *macro*,
9595
which is how metaprogramming is done in Rust. If it were a function instead, it

src/doc/trpl/plugins.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ If present, arguments passed as `#![plugin(foo(... args ...))]` are not
3939
interpreted by rustc itself. They are provided to the plugin through the
4040
`Registry`'s [`args` method](../rustc/plugin/registry/struct.Registry.html#method.args).
4141

42+
In the vast majority of cases, a plugin should *only* be used through
43+
`#![plugin]` and not through an `extern crate` item. Linking a plugin would
44+
pull in all of libsyntax and librustc as dependencies of your crate. This is
45+
generally unwanted unless you are building another plugin. The
46+
`plugin_as_library` lint checks these guidelines.
47+
48+
The usual practice is to put compiler plugins in their own crate, separate from
49+
any `macro_rules!` macros or ordinary Rust code meant to be used by consumers
50+
of a library.
51+
4252
# Syntax extensions
4353

4454
Plugins can extend Rust's syntax in various ways. One kind of syntax extension

src/doc/trpl/variable-bindings.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ let x: i32 = 5;
4040
If I asked you to read this out loud to the rest of the class, you'd say "`x`
4141
is a binding with the type `i32` and the value `five`."
4242

43+
In this case we chose to represent `x` as a 32-bit signed integer. Rust has
44+
many different primitive integer types. They begin with `i` for signed integers
45+
and `u` for unsigned integers. The possible integer sizes are 8, 16, 32, and 64
46+
bits.
47+
4348
In future examples, we may annotate the type in a comment. The examples will
4449
look like this:
4550

src/etc/CONFIGS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Configs
2+
3+
Here are some links to repos with configs which ease the use of rust:
4+
5+
* [rust.vim](https://github.com/rust-lang/rust.vim)
6+
* [emacs rust-mode](https://github.com/rust-lang/rust-mode)
7+
* [gedit-config](https://github.com/rust-lang/gedit-config)
8+
* [kate-config](https://github.com/rust-lang/kate-config)
9+
* [nano-config](https://github.com/rust-lang/nano-config)
10+
* [zsh-config](https://github.com/rust-lang/zsh-config)

0 commit comments

Comments
 (0)