Skip to content

Commit 7789881

Browse files
committed
Auto merge of #39030 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 10 pull requests - Successful merges: #38362, #38636, #38877, #38946, #38965, #38986, #38994, #38995, #39024, #39027 - Failed merges:
2 parents 8780962 + a861eb0 commit 7789881

File tree

15 files changed

+337
-74
lines changed

15 files changed

+337
-74
lines changed

src/doc/book/ffi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ However it is often desired that the callback is targeted to a special
309309
Rust object. This could be the object that represents the wrapper for the
310310
respective C object.
311311
312-
This can be achieved by passing an raw pointer to the object down to the
312+
This can be achieved by passing a raw pointer to the object down to the
313313
C library. The C library can then include the pointer to the Rust object in
314314
the notification. This will allow the callback to unsafely access the
315315
referenced Rust object.

src/doc/nomicon/dropck.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ is that some Drop implementations will not access borrowed data even
125125
though their type gives them the capability for such access.
126126

127127
For example, this variant of the above `Inspector` example will never
128-
accessed borrowed data:
128+
access borrowed data:
129129

130130
```rust,ignore
131131
struct Inspector<'a>(&'a u8, &'static str);

src/doc/nomicon/unbounded-lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ lifetime can be regarded as `'static`.
1111

1212
Almost no reference is `'static`, so this is probably wrong. `transmute` and
1313
`transmute_copy` are the two other primary offenders. One should endeavor to
14-
bound an unbounded lifetime as quick as possible, especially across function
14+
bound an unbounded lifetime as quickly as possible, especially across function
1515
boundaries.
1616

1717
Given a function, any output lifetimes that don't derive from inputs are

src/libcollections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,11 +1990,11 @@ impl<'a, K: Ord, V> Entry<'a, K, V> {
19901990
/// use std::collections::BTreeMap;
19911991
///
19921992
/// let mut map: BTreeMap<&str, String> = BTreeMap::new();
1993-
/// let s = "hoho".to_owned();
1993+
/// let s = "hoho".to_string();
19941994
///
19951995
/// map.entry("poneyland").or_insert_with(|| s);
19961996
///
1997-
/// assert_eq!(map["poneyland"], "hoho".to_owned());
1997+
/// assert_eq!(map["poneyland"], "hoho".to_string());
19981998
/// ```
19991999
#[stable(feature = "rust1", since = "1.0.0")]
20002000
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V {

src/libcollections/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ impl<T> [T] {
423423
core_slice::SliceExt::get_unchecked_mut(self, index)
424424
}
425425

426-
/// Returns an raw pointer to the slice's buffer.
426+
/// Returns a raw pointer to the slice's buffer.
427427
///
428428
/// The caller must ensure that the slice outlives the pointer this
429429
/// function returns, or else it will end up pointing to garbage.

src/libcompiler_builtins/build.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,6 @@ fn main() {
236236
"atomic_thread_fence.c"]);
237237
}
238238

239-
if !target.contains("redox") && !target.contains("windows") {
240-
sources.extend(&["emutls.c"]);
241-
}
242-
243239
if target.contains("msvc") {
244240
if target.contains("x86_64") {
245241
sources.extend(&["x86_64/floatdidf.c", "x86_64/floatdisf.c", "x86_64/floatdixf.c"]);

src/libcore/any.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub trait Any: 'static {
101101
///
102102
/// fn main() {
103103
/// assert_eq!(is_string(&0), false);
104-
/// assert_eq!(is_string(&"cookie monster".to_owned()), true);
104+
/// assert_eq!(is_string(&"cookie monster".to_string()), true);
105105
/// }
106106
/// ```
107107
#[unstable(feature = "get_type_id",
@@ -154,7 +154,7 @@ impl Any {
154154
///
155155
/// fn main() {
156156
/// is_string(&0);
157-
/// is_string(&"cookie monster".to_owned());
157+
/// is_string(&"cookie monster".to_string());
158158
/// }
159159
/// ```
160160
#[stable(feature = "rust1", since = "1.0.0")]
@@ -188,7 +188,7 @@ impl Any {
188188
///
189189
/// fn main() {
190190
/// print_if_string(&0);
191-
/// print_if_string(&"cookie monster".to_owned());
191+
/// print_if_string(&"cookie monster".to_string());
192192
/// }
193193
/// ```
194194
#[stable(feature = "rust1", since = "1.0.0")]
@@ -219,7 +219,7 @@ impl Any {
219219
///
220220
/// fn main() {
221221
/// let mut x = 10u32;
222-
/// let mut s = "starlord".to_owned();
222+
/// let mut s = "starlord".to_string();
223223
///
224224
/// modify_if_u32(&mut x);
225225
/// modify_if_u32(&mut s);
@@ -259,7 +259,7 @@ impl Any+Send {
259259
///
260260
/// fn main() {
261261
/// is_string(&0);
262-
/// is_string(&"cookie monster".to_owned());
262+
/// is_string(&"cookie monster".to_string());
263263
/// }
264264
/// ```
265265
#[stable(feature = "rust1", since = "1.0.0")]
@@ -285,7 +285,7 @@ impl Any+Send {
285285
///
286286
/// fn main() {
287287
/// print_if_string(&0);
288-
/// print_if_string(&"cookie monster".to_owned());
288+
/// print_if_string(&"cookie monster".to_string());
289289
/// }
290290
/// ```
291291
#[stable(feature = "rust1", since = "1.0.0")]
@@ -309,7 +309,7 @@ impl Any+Send {
309309
///
310310
/// fn main() {
311311
/// let mut x = 10u32;
312-
/// let mut s = "starlord".to_owned();
312+
/// let mut s = "starlord".to_string();
313313
///
314314
/// modify_if_u32(&mut x);
315315
/// modify_if_u32(&mut s);
@@ -359,7 +359,7 @@ impl TypeId {
359359
///
360360
/// fn main() {
361361
/// assert_eq!(is_string(&0), false);
362-
/// assert_eq!(is_string(&"cookie monster".to_owned()), true);
362+
/// assert_eq!(is_string(&"cookie monster".to_string()), true);
363363
/// }
364364
/// ```
365365
#[stable(feature = "rust1", since = "1.0.0")]

src/libcore/iter/iterator.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ pub trait Iterator {
16121612

16131613
/// Returns the maximum element of an iterator.
16141614
///
1615-
/// If the two elements are equally maximum, the latest element is
1615+
/// If several elements are equally maximum, the last element is
16161616
/// returned.
16171617
///
16181618
/// # Examples
@@ -1638,7 +1638,7 @@ pub trait Iterator {
16381638

16391639
/// Returns the minimum element of an iterator.
16401640
///
1641-
/// If the two elements are equally minimum, the first element is
1641+
/// If several elements are equally minimum, the first element is
16421642
/// returned.
16431643
///
16441644
/// # Examples
@@ -1665,8 +1665,8 @@ pub trait Iterator {
16651665
/// Returns the element that gives the maximum value from the
16661666
/// specified function.
16671667
///
1668-
/// Returns the rightmost element if the comparison determines two elements
1669-
/// to be equally maximum.
1668+
/// If several elements are equally maximum, the last element is
1669+
/// returned.
16701670
///
16711671
/// # Examples
16721672
///
@@ -1690,8 +1690,8 @@ pub trait Iterator {
16901690
/// Returns the element that gives the maximum value with respect to the
16911691
/// specified comparison function.
16921692
///
1693-
/// Returns the rightmost element if the comparison determines two elements
1694-
/// to be equally maximum.
1693+
/// If several elements are equally maximum, the last element is
1694+
/// returned.
16951695
///
16961696
/// # Examples
16971697
///
@@ -1715,8 +1715,8 @@ pub trait Iterator {
17151715
/// Returns the element that gives the minimum value from the
17161716
/// specified function.
17171717
///
1718-
/// Returns the latest element if the comparison determines two elements
1719-
/// to be equally minimum.
1718+
/// If several elements are equally minimum, the first element is
1719+
/// returned.
17201720
///
17211721
/// # Examples
17221722
///
@@ -1739,8 +1739,8 @@ pub trait Iterator {
17391739
/// Returns the element that gives the minimum value with respect to the
17401740
/// specified comparison function.
17411741
///
1742-
/// Returns the latest element if the comparison determines two elements
1743-
/// to be equally minimum.
1742+
/// If several elements are equally minimum, the first element is
1743+
/// returned.
17441744
///
17451745
/// # Examples
17461746
///

src/libcore/iter/traits.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,10 @@ impl<I: Iterator> IntoIterator for I {
260260
///
261261
/// Iterators produce a series of values, and collections can also be thought
262262
/// of as a series of values. The `Extend` trait bridges this gap, allowing you
263-
/// to extend a collection by including the contents of that iterator.
263+
/// to extend a collection by including the contents of that iterator. When
264+
/// extending a collection with an already existing key, that entry is updated
265+
/// or, in the case of collections that permit multiple entries with equal
266+
/// keys, that entry is inserted.
264267
///
265268
/// # Examples
266269
///

src/libstd/collections/hash/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,11 +1779,11 @@ impl<'a, K, V> Entry<'a, K, V> {
17791779
/// use std::collections::HashMap;
17801780
///
17811781
/// let mut map: HashMap<&str, String> = HashMap::new();
1782-
/// let s = "hoho".to_owned();
1782+
/// let s = "hoho".to_string();
17831783
///
17841784
/// map.entry("poneyland").or_insert_with(|| s);
17851785
///
1786-
/// assert_eq!(map["poneyland"], "hoho".to_owned());
1786+
/// assert_eq!(map["poneyland"], "hoho".to_string());
17871787
/// ```
17881788
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V {
17891789
match self {

src/libstd/io/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,12 @@ impl Error {
388388
/// impl MyError {
389389
/// fn new() -> MyError {
390390
/// MyError {
391-
/// v: "oh no!".to_owned()
391+
/// v: "oh no!".to_string()
392392
/// }
393393
/// }
394394
///
395395
/// fn change_message(&mut self, new_message: &str) {
396-
/// self.v = new_message.to_owned();
396+
/// self.v = new_message.to_string();
397397
/// }
398398
/// }
399399
///

src/libstd/net/udp.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -883,11 +883,23 @@ mod tests {
883883

884884
#[test]
885885
fn set_nonblocking() {
886-
let addr = next_test_ip4();
886+
each_ip(&mut |addr, _| {
887+
let socket = t!(UdpSocket::bind(&addr));
887888

888-
let stream = t!(UdpSocket::bind(&addr));
889+
t!(socket.set_nonblocking(true));
890+
t!(socket.set_nonblocking(false));
891+
892+
t!(socket.connect(addr));
889893

890-
t!(stream.set_nonblocking(true));
891-
t!(stream.set_nonblocking(false));
894+
t!(socket.set_nonblocking(false));
895+
t!(socket.set_nonblocking(true));
896+
897+
let mut buf = [0];
898+
match socket.recv(&mut buf) {
899+
Ok(_) => panic!("expected error"),
900+
Err(ref e) if e.kind() == ErrorKind::WouldBlock => {}
901+
Err(e) => panic!("unexpected error {}", e),
902+
}
903+
})
892904
}
893905
}

0 commit comments

Comments
 (0)