Skip to content

Commit

Permalink
Auto merge of #22397 - Manishearth:rollup, r=huonw
Browse files Browse the repository at this point in the history
None
  • Loading branch information
bors committed Feb 17, 2015
2 parents 22224ca + 35ee895 commit f1bb6c2
Show file tree
Hide file tree
Showing 72 changed files with 1,189 additions and 426 deletions.
8 changes: 4 additions & 4 deletions mk/docs.mk
Expand Up @@ -129,21 +129,21 @@ doc/:
HTML_DEPS += doc/rust.css
doc/rust.css: $(D)/rust.css | doc/
@$(call E, cp: $@)
$(Q)cp -a $< $@ 2> /dev/null
$(Q)cp -PRp $< $@ 2> /dev/null

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

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

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

# The (english) documentation for each doc item.

Expand Down
10 changes: 5 additions & 5 deletions mk/tests.mk
Expand Up @@ -38,23 +38,23 @@ ifdef CHECK_IGNORED
TESTARGS += --ignored
endif


# Arguments to the cfail/rfail/rpass/bench tests
ifdef CFG_VALGRIND
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
endif

ifdef PLEASE_BENCH
TESTARGS += --bench
endif

# Arguments to the perf tests
ifdef CFG_PERF_TOOL
CTEST_PERF_RUNTOOL = --runtool "$(CFG_PERF_TOOL)"
endif

CTEST_TESTARGS := $(TESTARGS)

# --bench is only relevant for crate tests, not for the compile tests
ifdef PLEASE_BENCH
TESTARGS += --bench
endif

ifdef VERBOSE
CTEST_TESTARGS += --verbose
endif
Expand Down
7 changes: 3 additions & 4 deletions src/doc/reference.md
Expand Up @@ -648,7 +648,7 @@ All of the above extensions are expressions with values.

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

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

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

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

Expand Down
1 change: 1 addition & 0 deletions src/doc/trpl/SUMMARY.md
Expand Up @@ -37,3 +37,4 @@
* [Macros](macros.md)
* [Compiler Plugins](plugins.md)
* [Conclusion](conclusion.md)
* [Glossary](glossary.md)
3 changes: 2 additions & 1 deletion src/doc/trpl/compound-data-types.md
Expand Up @@ -47,7 +47,8 @@ This pattern is very powerful, and we'll see it repeated more later.

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

```rust
let mut x = (1, 2); // x: (i32, i32)
Expand Down
16 changes: 16 additions & 0 deletions src/doc/trpl/glossary.md
@@ -0,0 +1,16 @@
% Glossary

Not every Rustacean has a background in systems programming, nor in computer
science, so we've added explanations of terms that might be unfamiliar.

### Arity

Arity refers to the number of arguments a function or operation takes.

```rust
let x = (2, 3);
let y = (4, 6);
let z = (8, 2, 6);
```

In the example above `x` and `y` have arity 2. `z` has arity 3.
2 changes: 1 addition & 1 deletion src/doc/trpl/hello-world.md
Expand Up @@ -89,7 +89,7 @@ This line does all of the work in our little program. There are a number of
details that are important here. The first is that it's indented with four
spaces, not tabs. Please configure your editor of choice to insert four spaces
with the tab key. We provide some [sample configurations for various
editors](https://github.com/rust-lang/rust/tree/master/src/etc).
editors](https://github.com/rust-lang/rust/tree/master/src/etc/CONFIGS.md).

The second point is the `println!()` part. This is calling a Rust *macro*,
which is how metaprogramming is done in Rust. If it were a function instead, it
Expand Down
10 changes: 10 additions & 0 deletions src/doc/trpl/plugins.md
Expand Up @@ -39,6 +39,16 @@ If present, arguments passed as `#![plugin(foo(... args ...))]` are not
interpreted by rustc itself. They are provided to the plugin through the
`Registry`'s [`args` method](../rustc/plugin/registry/struct.Registry.html#method.args).

In the vast majority of cases, a plugin should *only* be used through
`#![plugin]` and not through an `extern crate` item. Linking a plugin would
pull in all of libsyntax and librustc as dependencies of your crate. This is
generally unwanted unless you are building another plugin. The
`plugin_as_library` lint checks these guidelines.

The usual practice is to put compiler plugins in their own crate, separate from
any `macro_rules!` macros or ordinary Rust code meant to be used by consumers
of a library.

# Syntax extensions

Plugins can extend Rust's syntax in various ways. One kind of syntax extension
Expand Down
5 changes: 5 additions & 0 deletions src/doc/trpl/variable-bindings.md
Expand Up @@ -40,6 +40,11 @@ let x: i32 = 5;
If I asked you to read this out loud to the rest of the class, you'd say "`x`
is a binding with the type `i32` and the value `five`."

In this case we chose to represent `x` as a 32-bit signed integer. Rust has
many different primitive integer types. They begin with `i` for signed integers
and `u` for unsigned integers. The possible integer sizes are 8, 16, 32, and 64
bits.

In future examples, we may annotate the type in a comment. The examples will
look like this:

Expand Down
10 changes: 10 additions & 0 deletions src/etc/CONFIGS.md
@@ -0,0 +1,10 @@
# Configs

Here are some links to repos with configs which ease the use of rust:

* [rust.vim](https://github.com/rust-lang/rust.vim)
* [emacs rust-mode](https://github.com/rust-lang/rust-mode)
* [gedit-config](https://github.com/rust-lang/gedit-config)
* [kate-config](https://github.com/rust-lang/kate-config)
* [nano-config](https://github.com/rust-lang/nano-config)
* [zsh-config](https://github.com/rust-lang/zsh-config)
3 changes: 3 additions & 0 deletions src/etc/rustup.sh
Expand Up @@ -241,6 +241,9 @@ create_tmp_dir() {
echo $TMP_DIR
}

# Make `tr` locale independent
LC_CTYPE=C

probe_need CFG_CURL curl
probe_need CFG_TAR tar
probe_need CFG_FILE file
Expand Down
24 changes: 24 additions & 0 deletions src/libcollections/binary_heap.rs
Expand Up @@ -655,6 +655,8 @@ impl<T: Ord> FromIterator<T> for BinaryHeap<T> {
}
}

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

Expand All @@ -663,6 +665,18 @@ impl<T: Ord> IntoIterator for BinaryHeap<T> {
}
}

#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
impl<T: Ord> IntoIterator for BinaryHeap<T> {
type Item = T;
type IntoIter = IntoIter<T>;

fn into_iter(self) -> IntoIter<T> {
self.into_iter()
}
}

// NOTE(stage0): remove impl after a snapshot
#[cfg(stage0)]
impl<'a, T> IntoIterator for &'a BinaryHeap<T> where T: Ord {
type IntoIter = Iter<'a, T>;

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

#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
impl<'a, T> IntoIterator for &'a BinaryHeap<T> where T: Ord {
type Item = &'a T;
type IntoIter = Iter<'a, T>;

fn into_iter(self) -> Iter<'a, T> {
self.iter()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Ord> Extend<T> for BinaryHeap<T> {
fn extend<Iter: Iterator<Item=T>>(&mut self, iter: Iter) {
Expand Down
24 changes: 24 additions & 0 deletions src/libcollections/bit.rs
Expand Up @@ -1070,6 +1070,8 @@ impl<'a> RandomAccessIterator for Iter<'a> {
}
}

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

Expand All @@ -1078,6 +1080,16 @@ impl<'a> IntoIterator for &'a Bitv {
}
}

#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
impl<'a> IntoIterator for &'a Bitv {
type Item = bool;
type IntoIter = Iter<'a>;

fn into_iter(self) -> Iter<'a> {
self.iter()
}
}

/// An implementation of a set using a bit vector as an underlying
/// representation for holding unsigned numerical elements.
///
Expand Down Expand Up @@ -1882,6 +1894,8 @@ impl<'a> Iterator for SymmetricDifference<'a> {
#[inline] fn size_hint(&self) -> (usize, Option<usize>) { self.0.size_hint() }
}

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

Expand All @@ -1890,6 +1904,16 @@ impl<'a> IntoIterator for &'a BitvSet {
}
}

#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
impl<'a> IntoIterator for &'a BitvSet {
type Item = usize;
type IntoIter = SetIter<'a>;

fn into_iter(self) -> SetIter<'a> {
self.iter()
}
}

#[cfg(test)]
mod tests {
use prelude::*;
Expand Down
36 changes: 36 additions & 0 deletions src/libcollections/btree/map.rs
Expand Up @@ -462,6 +462,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
}
}

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

Expand All @@ -470,6 +472,18 @@ impl<K, V> IntoIterator for BTreeMap<K, V> {
}
}

#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
impl<K, V> IntoIterator for BTreeMap<K, V> {
type Item = (K, V);
type IntoIter = IntoIter<K, V>;

fn into_iter(self) -> IntoIter<K, V> {
self.into_iter()
}
}

// NOTE(stage0): remove impl after a snapshot
#[cfg(stage0)]
impl<'a, K, V> IntoIterator for &'a BTreeMap<K, V> {
type IntoIter = Iter<'a, K, V>;

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

#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
impl<'a, K, V> IntoIterator for &'a BTreeMap<K, V> {
type Item = (&'a K, &'a V);
type IntoIter = Iter<'a, K, V>;

fn into_iter(self) -> Iter<'a, K, V> {
self.iter()
}
}

// NOTE(stage0): remove impl after a snapshot
#[cfg(stage0)]
impl<'a, K, V> IntoIterator for &'a mut BTreeMap<K, V> {
type IntoIter = IterMut<'a, K, V>;

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

#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
impl<'a, K, V> IntoIterator for &'a mut BTreeMap<K, V> {
type Item = (&'a K, &'a mut V);
type IntoIter = IterMut<'a, K, V>;

fn into_iter(mut self) -> IterMut<'a, K, V> {
self.iter_mut()
}
}

/// A helper enum useful for deciding whether to continue a loop since we can't
/// return from a closure
enum Continuation<A, B> {
Expand Down
24 changes: 24 additions & 0 deletions src/libcollections/btree/set.rs
Expand Up @@ -480,6 +480,8 @@ impl<T: Ord> FromIterator<T> for BTreeSet<T> {
}
}

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

Expand All @@ -488,6 +490,18 @@ impl<T> IntoIterator for BTreeSet<T> {
}
}

#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
impl<T> IntoIterator for BTreeSet<T> {
type Item = T;
type IntoIter = IntoIter<T>;

fn into_iter(self) -> IntoIter<T> {
self.into_iter()
}
}

// NOTE(stage0): remove impl after a snapshot
#[cfg(stage0)]
impl<'a, T> IntoIterator for &'a BTreeSet<T> {
type IntoIter = Iter<'a, T>;

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

#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot
impl<'a, T> IntoIterator for &'a BTreeSet<T> {
type Item = &'a T;
type IntoIter = Iter<'a, T>;

fn into_iter(self) -> Iter<'a, T> {
self.iter()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Ord> Extend<T> for BTreeSet<T> {
#[inline]
Expand Down

0 comments on commit f1bb6c2

Please sign in to comment.