Skip to content

Commit da0ccd8

Browse files
committed
Auto merge of #32046 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #32002, #32017, #32027, #32035, #32036 - Failed merges:
2 parents d31d8a9 + d5aeb76 commit da0ccd8

File tree

6 files changed

+34
-5
lines changed

6 files changed

+34
-5
lines changed

src/bootstrap/build/sanity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub fn check(build: &mut Build) {
7979
}
8080

8181
// Make sure musl-root is valid if specified
82-
if target.contains("musl") {
82+
if target.contains("musl") && target.contains("x86_64") {
8383
match build.config.musl_root {
8484
Some(ref root) => {
8585
if fs::metadata(root.join("lib/libc.a")).is_err() {

src/doc/book/vectors.md

+30
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,36 @@ for i in v {
115115
}
116116
```
117117

118+
Note: You cannot use the vector again once you have iterated by taking ownership of the vector.
119+
You can iterate the vector multiple times by taking a reference to the vector whilst iterating.
120+
For example, the following code does not compile.
121+
122+
```rust,ignore
123+
let mut v = vec![1, 2, 3, 4, 5];
124+
125+
for i in v {
126+
println!("Take ownership of the vector and its element {}", i);
127+
}
128+
129+
for i in v {
130+
println!("Take ownership of the vector and its element {}", i);
131+
}
132+
```
133+
134+
Whereas the following works perfectly,
135+
136+
```rust
137+
let mut v = vec![1, 2, 3, 4, 5];
138+
139+
for i in &v {
140+
println!("This is a reference to {}", i);
141+
}
142+
143+
for i in &v {
144+
println!("This is a reference to {}", i);
145+
}
146+
```
147+
118148
Vectors have many more useful methods, which you can read about in [their
119149
API documentation][vec].
120150

src/libcore/iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ pub trait Iterator {
15321532
/// An iterator adaptor that applies a function, producing a single, final value.
15331533
///
15341534
/// `fold()` takes two arguments: an initial value, and a closure with two
1535-
/// arguments: an 'accumulator', and an element. It returns the value that
1535+
/// arguments: an 'accumulator', and an element. The closure returns the value that
15361536
/// the accumulator should have for the next iteration.
15371537
///
15381538
/// The initial value is the value the accumulator will have on the first

src/libcore/str/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1095,8 +1095,6 @@ fn eq_slice(a: &str, b: &str) -> bool {
10951095
/// faster than comparing each byte in a loop.
10961096
#[inline]
10971097
unsafe fn cmp_slice(a: &str, b: &str, len: usize) -> i32 {
1098-
// NOTE: In theory n should be libc::size_t and not usize, but libc is not available here
1099-
#[allow(improper_ctypes)]
11001098
extern { fn memcmp(s1: *const i8, s2: *const i8, n: usize) -> i32; }
11011099
memcmp(a.as_ptr() as *const i8, b.as_ptr() as *const i8, len)
11021100
}

src/libstd/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn main() {
2828
}
2929

3030
if target.contains("unknown-linux") {
31-
if target.contains("musl") {
31+
if target.contains("musl") && target.contains("x86_64") {
3232
println!("cargo:rustc-link-lib=static=unwind");
3333
} else {
3434
println!("cargo:rustc-link-lib=dl");

src/test/rustdoc/issue-27362.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// aux-build:issue-27362.rs
1212
// ignore-cross-compile
13+
// ignore-test This test fails on beta/stable #32019
1314

1415
extern crate issue_27362;
1516
pub use issue_27362 as quux;

0 commit comments

Comments
 (0)