about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-03-04 21:01:14 +0000
committerbors <bors@rust-lang.org>2016-03-04 21:01:14 +0000
commitda0ccd8cc98b5a4f2edcaf1e4f67738f720bc86b (patch)
tree1cabc62db300d796a2f0791375995a3c23ff67a1 /src
parentd31d8a9a919b705fb8d22ba99a693d9f96b8bdd5 (diff)
parentd5aeb769e998ed40a0dc935a0648f9bf1bd4292e (diff)
downloadrust-da0ccd8cc98b5a4f2edcaf1e4f67738f720bc86b.tar.gz
rust-da0ccd8cc98b5a4f2edcaf1e4f67738f720bc86b.zip
Auto merge of #32046 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #32002, #32017, #32027, #32035, #32036
- Failed merges:
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/build/sanity.rs2
-rw-r--r--src/doc/book/vectors.md30
-rw-r--r--src/libcore/iter.rs2
-rw-r--r--src/libcore/str/mod.rs2
-rw-r--r--src/libstd/build.rs2
-rw-r--r--src/test/rustdoc/issue-27362.rs1
6 files changed, 34 insertions, 5 deletions
diff --git a/src/bootstrap/build/sanity.rs b/src/bootstrap/build/sanity.rs
index 40f4c707609..6ac581a7c69 100644
--- a/src/bootstrap/build/sanity.rs
+++ b/src/bootstrap/build/sanity.rs
@@ -79,7 +79,7 @@ pub fn check(build: &mut Build) {
         }
 
         // Make sure musl-root is valid if specified
-        if target.contains("musl") {
+        if target.contains("musl") && target.contains("x86_64") {
             match build.config.musl_root {
                 Some(ref root) => {
                     if fs::metadata(root.join("lib/libc.a")).is_err() {
diff --git a/src/doc/book/vectors.md b/src/doc/book/vectors.md
index f5a543d75b1..ceb6b3c003e 100644
--- a/src/doc/book/vectors.md
+++ b/src/doc/book/vectors.md
@@ -115,6 +115,36 @@ for i in v {
 }
 ```
 
+Note: You cannot use the vector again once you have iterated by taking ownership of the vector.
+You can iterate the vector multiple times by taking a reference to the vector whilst iterating. 
+For example, the following code does not compile.
+
+```rust,ignore
+let mut v = vec![1, 2, 3, 4, 5];
+
+for i in v {
+    println!("Take ownership of the vector and its element {}", i);
+}
+
+for i in v {
+    println!("Take ownership of the vector and its element {}", i);
+}
+```
+
+Whereas the following works perfectly,
+
+```rust
+let mut v = vec![1, 2, 3, 4, 5];
+
+for i in &v {
+    println!("This is a reference to {}", i);
+}
+
+for i in &v {
+    println!("This is a reference to {}", i);
+}
+```
+
 Vectors have many more useful methods, which you can read about in [their
 API documentation][vec].
 
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index d6bd9dbf4bd..a730b9bd518 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -1532,7 +1532,7 @@ pub trait Iterator {
     /// An iterator adaptor that applies a function, producing a single, final value.
     ///
     /// `fold()` takes two arguments: an initial value, and a closure with two
-    /// arguments: an 'accumulator', and an element. It returns the value that
+    /// arguments: an 'accumulator', and an element. The closure returns the value that
     /// the accumulator should have for the next iteration.
     ///
     /// The initial value is the value the accumulator will have on the first
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs
index a555b859291..2d898b50e0c 100644
--- a/src/libcore/str/mod.rs
+++ b/src/libcore/str/mod.rs
@@ -1095,8 +1095,6 @@ fn eq_slice(a: &str, b: &str) -> bool {
 /// faster than comparing each byte in a loop.
 #[inline]
 unsafe fn cmp_slice(a: &str, b: &str, len: usize) -> i32 {
-    // NOTE: In theory n should be libc::size_t and not usize, but libc is not available here
-    #[allow(improper_ctypes)]
     extern { fn memcmp(s1: *const i8, s2: *const i8, n: usize) -> i32; }
     memcmp(a.as_ptr() as *const i8, b.as_ptr() as *const i8, len)
 }
diff --git a/src/libstd/build.rs b/src/libstd/build.rs
index a1144a964fd..c60ec4d3655 100644
--- a/src/libstd/build.rs
+++ b/src/libstd/build.rs
@@ -28,7 +28,7 @@ fn main() {
     }
 
     if target.contains("unknown-linux") {
-        if target.contains("musl") {
+        if target.contains("musl") && target.contains("x86_64") {
             println!("cargo:rustc-link-lib=static=unwind");
         } else {
             println!("cargo:rustc-link-lib=dl");
diff --git a/src/test/rustdoc/issue-27362.rs b/src/test/rustdoc/issue-27362.rs
index 179778fd128..b28fb7ec47a 100644
--- a/src/test/rustdoc/issue-27362.rs
+++ b/src/test/rustdoc/issue-27362.rs
@@ -10,6 +10,7 @@
 
 // aux-build:issue-27362.rs
 // ignore-cross-compile
+// ignore-test This test fails on beta/stable #32019
 
 extern crate issue_27362;
 pub use issue_27362 as quux;