Skip to content

Commit f1bb6c2

Browse files
committed
Auto merge of #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

+4-4
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

+5-5
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

+3-4
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

+1
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

+2-1
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

+16
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

+1-1
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

+10
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

+5
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

+10
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)

src/etc/rustup.sh

+3
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ create_tmp_dir() {
241241
echo $TMP_DIR
242242
}
243243

244+
# Make `tr` locale independent
245+
LC_CTYPE=C
246+
244247
probe_need CFG_CURL curl
245248
probe_need CFG_TAR tar
246249
probe_need CFG_FILE file

src/libcollections/binary_heap.rs

+24
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,8 @@ impl<T: Ord> FromIterator<T> for BinaryHeap<T> {
655655
}
656656
}
657657

658+
// NOTE(stage0): remove impl after a snapshot
659+
#[cfg(stage0)]
658660
impl<T: Ord> IntoIterator for BinaryHeap<T> {
659661
type IntoIter = IntoIter<T>;
660662

@@ -663,6 +665,18 @@ impl<T: Ord> IntoIterator for BinaryHeap<T> {
663665
}
664666
}
665667

668+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
669+
impl<T: Ord> IntoIterator for BinaryHeap<T> {
670+
type Item = T;
671+
type IntoIter = IntoIter<T>;
672+
673+
fn into_iter(self) -> IntoIter<T> {
674+
self.into_iter()
675+
}
676+
}
677+
678+
// NOTE(stage0): remove impl after a snapshot
679+
#[cfg(stage0)]
666680
impl<'a, T> IntoIterator for &'a BinaryHeap<T> where T: Ord {
667681
type IntoIter = Iter<'a, T>;
668682

@@ -671,6 +685,16 @@ impl<'a, T> IntoIterator for &'a BinaryHeap<T> where T: Ord {
671685
}
672686
}
673687

688+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
689+
impl<'a, T> IntoIterator for &'a BinaryHeap<T> where T: Ord {
690+
type Item = &'a T;
691+
type IntoIter = Iter<'a, T>;
692+
693+
fn into_iter(self) -> Iter<'a, T> {
694+
self.iter()
695+
}
696+
}
697+
674698
#[stable(feature = "rust1", since = "1.0.0")]
675699
impl<T: Ord> Extend<T> for BinaryHeap<T> {
676700
fn extend<Iter: Iterator<Item=T>>(&mut self, iter: Iter) {

src/libcollections/bit.rs

+24
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,8 @@ impl<'a> RandomAccessIterator for Iter<'a> {
10701070
}
10711071
}
10721072

1073+
// NOTE(stage0): remove impl after a snapshot
1074+
#[cfg(stage0)]
10731075
impl<'a> IntoIterator for &'a Bitv {
10741076
type IntoIter = Iter<'a>;
10751077

@@ -1078,6 +1080,16 @@ impl<'a> IntoIterator for &'a Bitv {
10781080
}
10791081
}
10801082

1083+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1084+
impl<'a> IntoIterator for &'a Bitv {
1085+
type Item = bool;
1086+
type IntoIter = Iter<'a>;
1087+
1088+
fn into_iter(self) -> Iter<'a> {
1089+
self.iter()
1090+
}
1091+
}
1092+
10811093
/// An implementation of a set using a bit vector as an underlying
10821094
/// representation for holding unsigned numerical elements.
10831095
///
@@ -1882,6 +1894,8 @@ impl<'a> Iterator for SymmetricDifference<'a> {
18821894
#[inline] fn size_hint(&self) -> (usize, Option<usize>) { self.0.size_hint() }
18831895
}
18841896

1897+
// NOTE(stage0): remove impl after a snapshot
1898+
#[cfg(stage0)]
18851899
impl<'a> IntoIterator for &'a BitvSet {
18861900
type IntoIter = SetIter<'a>;
18871901

@@ -1890,6 +1904,16 @@ impl<'a> IntoIterator for &'a BitvSet {
18901904
}
18911905
}
18921906

1907+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
1908+
impl<'a> IntoIterator for &'a BitvSet {
1909+
type Item = usize;
1910+
type IntoIter = SetIter<'a>;
1911+
1912+
fn into_iter(self) -> SetIter<'a> {
1913+
self.iter()
1914+
}
1915+
}
1916+
18931917
#[cfg(test)]
18941918
mod tests {
18951919
use prelude::*;

src/libcollections/btree/map.rs

+36
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
462462
}
463463
}
464464

465+
// NOTE(stage0): remove impl after a snapshot
466+
#[cfg(stage0)]
465467
impl<K, V> IntoIterator for BTreeMap<K, V> {
466468
type IntoIter = IntoIter<K, V>;
467469

@@ -470,6 +472,18 @@ impl<K, V> IntoIterator for BTreeMap<K, V> {
470472
}
471473
}
472474

475+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
476+
impl<K, V> IntoIterator for BTreeMap<K, V> {
477+
type Item = (K, V);
478+
type IntoIter = IntoIter<K, V>;
479+
480+
fn into_iter(self) -> IntoIter<K, V> {
481+
self.into_iter()
482+
}
483+
}
484+
485+
// NOTE(stage0): remove impl after a snapshot
486+
#[cfg(stage0)]
473487
impl<'a, K, V> IntoIterator for &'a BTreeMap<K, V> {
474488
type IntoIter = Iter<'a, K, V>;
475489

@@ -478,6 +492,18 @@ impl<'a, K, V> IntoIterator for &'a BTreeMap<K, V> {
478492
}
479493
}
480494

495+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
496+
impl<'a, K, V> IntoIterator for &'a BTreeMap<K, V> {
497+
type Item = (&'a K, &'a V);
498+
type IntoIter = Iter<'a, K, V>;
499+
500+
fn into_iter(self) -> Iter<'a, K, V> {
501+
self.iter()
502+
}
503+
}
504+
505+
// NOTE(stage0): remove impl after a snapshot
506+
#[cfg(stage0)]
481507
impl<'a, K, V> IntoIterator for &'a mut BTreeMap<K, V> {
482508
type IntoIter = IterMut<'a, K, V>;
483509

@@ -486,6 +512,16 @@ impl<'a, K, V> IntoIterator for &'a mut BTreeMap<K, V> {
486512
}
487513
}
488514

515+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
516+
impl<'a, K, V> IntoIterator for &'a mut BTreeMap<K, V> {
517+
type Item = (&'a K, &'a mut V);
518+
type IntoIter = IterMut<'a, K, V>;
519+
520+
fn into_iter(mut self) -> IterMut<'a, K, V> {
521+
self.iter_mut()
522+
}
523+
}
524+
489525
/// A helper enum useful for deciding whether to continue a loop since we can't
490526
/// return from a closure
491527
enum Continuation<A, B> {

src/libcollections/btree/set.rs

+24
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,8 @@ impl<T: Ord> FromIterator<T> for BTreeSet<T> {
480480
}
481481
}
482482

483+
// NOTE(stage0): remove impl after a snapshot
484+
#[cfg(stage0)]
483485
impl<T> IntoIterator for BTreeSet<T> {
484486
type IntoIter = IntoIter<T>;
485487

@@ -488,6 +490,18 @@ impl<T> IntoIterator for BTreeSet<T> {
488490
}
489491
}
490492

493+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
494+
impl<T> IntoIterator for BTreeSet<T> {
495+
type Item = T;
496+
type IntoIter = IntoIter<T>;
497+
498+
fn into_iter(self) -> IntoIter<T> {
499+
self.into_iter()
500+
}
501+
}
502+
503+
// NOTE(stage0): remove impl after a snapshot
504+
#[cfg(stage0)]
491505
impl<'a, T> IntoIterator for &'a BTreeSet<T> {
492506
type IntoIter = Iter<'a, T>;
493507

@@ -496,6 +510,16 @@ impl<'a, T> IntoIterator for &'a BTreeSet<T> {
496510
}
497511
}
498512

513+
#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
514+
impl<'a, T> IntoIterator for &'a BTreeSet<T> {
515+
type Item = &'a T;
516+
type IntoIter = Iter<'a, T>;
517+
518+
fn into_iter(self) -> Iter<'a, T> {
519+
self.iter()
520+
}
521+
}
522+
499523
#[stable(feature = "rust1", since = "1.0.0")]
500524
impl<T: Ord> Extend<T> for BTreeSet<T> {
501525
#[inline]

0 commit comments

Comments
 (0)