Skip to content

Commit fc57e40

Browse files
committed
Auto merge of #39296 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 6 pull requests - Successful merges: #38930, #39212, #39251, #39267, #39276, #39278 - Failed merges:
2 parents 1283c02 + a2fa75b commit fc57e40

File tree

7 files changed

+43
-36
lines changed

7 files changed

+43
-36
lines changed

src/doc/book/testing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ currently trying to run the tests. This can save compile time, and also ensures
384384
that our tests are entirely left out of a normal build.
385385

386386
The second change is the `use` declaration. Because we're in an inner module,
387-
we need to bring our test function into scope. This can be annoying if you have
387+
we need to bring the tested function into scope. This can be annoying if you have
388388
a large module, and so this is a common use of globs. Let's change our
389389
`src/lib.rs` to make use of it:
390390

src/libcore/ops.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -2776,7 +2776,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *mut T {}
27762776
#[unstable(feature = "coerce_unsized", issue = "27732")]
27772777
impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
27782778

2779-
/// Both `in (PLACE) EXPR` and `box EXPR` desugar into expressions
2779+
/// Both `PLACE <- EXPR` and `box EXPR` desugar into expressions
27802780
/// that allocate an intermediate "place" that holds uninitialized
27812781
/// state. The desugaring evaluates EXPR, and writes the result at
27822782
/// the address returned by the `pointer` method of this trait.
@@ -2791,7 +2791,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
27912791
/// converting the agent to an instance of the owning pointer, via the
27922792
/// appropriate `finalize` method (see the `InPlace`.
27932793
///
2794-
/// If evaluating EXPR fails, then the destructor for the
2794+
/// If evaluating EXPR fails, then it is up to the destructor for the
27952795
/// implementation of Place to clean up any intermediate state
27962796
/// (e.g. deallocate box storage, pop a stack, etc).
27972797
#[unstable(feature = "placement_new_protocol", issue = "27779")]
@@ -2802,9 +2802,9 @@ pub trait Place<Data: ?Sized> {
28022802
fn pointer(&mut self) -> *mut Data;
28032803
}
28042804

2805-
/// Interface to implementations of `in (PLACE) EXPR`.
2805+
/// Interface to implementations of `PLACE <- EXPR`.
28062806
///
2807-
/// `in (PLACE) EXPR` effectively desugars into:
2807+
/// `PLACE <- EXPR` effectively desugars into:
28082808
///
28092809
/// ```rust,ignore
28102810
/// let p = PLACE;
@@ -2817,7 +2817,7 @@ pub trait Place<Data: ?Sized> {
28172817
/// }
28182818
/// ```
28192819
///
2820-
/// The type of `in (PLACE) EXPR` is derived from the type of `PLACE`;
2820+
/// The type of `PLACE <- EXPR` is derived from the type of `PLACE`;
28212821
/// if the type of `PLACE` is `P`, then the final type of the whole
28222822
/// expression is `P::Place::Owner` (see the `InPlace` and `Boxed`
28232823
/// traits).
@@ -2835,12 +2835,12 @@ pub trait Placer<Data: ?Sized> {
28352835
fn make_place(self) -> Self::Place;
28362836
}
28372837

2838-
/// Specialization of `Place` trait supporting `in (PLACE) EXPR`.
2838+
/// Specialization of `Place` trait supporting `PLACE <- EXPR`.
28392839
#[unstable(feature = "placement_new_protocol", issue = "27779")]
28402840
pub trait InPlace<Data: ?Sized>: Place<Data> {
2841-
/// `Owner` is the type of the end value of `in (PLACE) EXPR`
2841+
/// `Owner` is the type of the end value of `PLACE <- EXPR`
28422842
///
2843-
/// Note that when `in (PLACE) EXPR` is solely used for
2843+
/// Note that when `PLACE <- EXPR` is solely used for
28442844
/// side-effecting an existing data-structure,
28452845
/// e.g. `Vec::emplace_back`, then `Owner` need not carry any
28462846
/// information at all (e.g. it can be the unit type `()` in that

src/libcoretest/hash/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ fn test_writer_hasher() {
6262

6363
let s: &str = "a";
6464
assert_eq!(hash(& s), 97 + 0xFF);
65-
// FIXME (#18283) Enable test
66-
//let s: Box<str> = box "a";
67-
//assert_eq!(hasher.hash(& s), 97 + 0xFF);
65+
let s: Box<str> = String::from("a").into_boxed_str();
66+
assert_eq!(hash(& s), 97 + 0xFF);
6867
let cs: &[u8] = &[1, 2, 3];
6968
assert_eq!(hash(& cs), 9);
7069
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.

src/librustc/hir/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub trait Visitor<'v> : Sized {
154154
/// hashed separately.
155155
///
156156
/// **If for some reason you want the nested behavior, but don't
157-
/// have a `Map` are your disposal:** then you should override the
157+
/// have a `Map` at your disposal:** then you should override the
158158
/// `visit_nested_XXX` methods, and override this method to
159159
/// `panic!()`. This way, if a new `visit_nested_XXX` variant is
160160
/// added in the future, we will see the panic in your code and

src/librustc/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ pub enum QPath {
10141014
///
10151015
/// UFCS source paths can desugar into this, with `Vec::new` turning into
10161016
/// `<Vec>::new`, and `T::X::Y::method` into `<<<T>::X>::Y>::method`,
1017-
/// the `X` and `Y` nodes being each a `TyPath(QPath::TypeRelative(..))`.
1017+
/// the `X` and `Y` nodes each being a `TyPath(QPath::TypeRelative(..))`.
10181018
TypeRelative(P<Ty>, P<PathSegment>)
10191019
}
10201020

src/libstd/primitive_docs.rs

+22-21
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ mod prim_pointer { }
272272
/// Arrays of sizes from 0 to 32 (inclusive) implement the following traits if
273273
/// the element type allows it:
274274
///
275-
/// - [`Clone`][clone] (only if `T: Copy`)
275+
/// - [`Clone`][clone] (only if `T: [Copy][copy]`)
276276
/// - [`Debug`][debug]
277277
/// - [`IntoIterator`][intoiterator] (implemented for `&[T; N]` and `&mut [T; N]`)
278278
/// - [`PartialEq`][partialeq], [`PartialOrd`][partialord], [`Eq`][eq], [`Ord`][ord]
@@ -287,8 +287,8 @@ mod prim_pointer { }
287287
/// entirely different types. As a stopgap, trait implementations are
288288
/// statically generated up to size 32.
289289
///
290-
/// Arrays of *any* size are [`Copy`][copy] if the element type is `Copy`. This
291-
/// works because the `Copy` trait is specially known to the compiler.
290+
/// Arrays of *any* size are [`Copy`][copy] if the element type is [`Copy`][copy]. This
291+
/// works because the [`Copy`][copy] trait is specially known to the compiler.
292292
///
293293
/// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on
294294
/// an array. Indeed, this provides most of the API for working with arrays.
@@ -297,23 +297,6 @@ mod prim_pointer { }
297297
/// There is no way to move elements out of an array. See [`mem::replace`][replace]
298298
/// for an alternative.
299299
///
300-
/// [slice]: primitive.slice.html
301-
/// [copy]: marker/trait.Copy.html
302-
/// [clone]: clone/trait.Clone.html
303-
/// [debug]: fmt/trait.Debug.html
304-
/// [intoiterator]: iter/trait.IntoIterator.html
305-
/// [partialeq]: cmp/trait.PartialEq.html
306-
/// [partialord]: cmp/trait.PartialOrd.html
307-
/// [eq]: cmp/trait.Eq.html
308-
/// [ord]: cmp/trait.Ord.html
309-
/// [hash]: hash/trait.Hash.html
310-
/// [asref]: convert/trait.AsRef.html
311-
/// [asmut]: convert/trait.AsMut.html
312-
/// [borrow]: borrow/trait.Borrow.html
313-
/// [borrowmut]: borrow/trait.BorrowMut.html
314-
/// [default]: default/trait.Default.html
315-
/// [replace]: mem/fn.replace.html
316-
///
317300
/// # Examples
318301
///
319302
/// ```
@@ -347,13 +330,31 @@ mod prim_pointer { }
347330
/// ```
348331
///
349332
/// If the array has 32 or fewer elements (see above), you can also use the
350-
/// array reference's `IntoIterator` implementation:
333+
/// array reference's [`IntoIterator`] implementation:
351334
///
352335
/// ```
353336
/// # let array: [i32; 3] = [0; 3];
354337
/// for x in &array { }
355338
/// ```
356339
///
340+
/// [slice]: primitive.slice.html
341+
/// [copy]: marker/trait.Copy.html
342+
/// [clone]: clone/trait.Clone.html
343+
/// [debug]: fmt/trait.Debug.html
344+
/// [intoiterator]: iter/trait.IntoIterator.html
345+
/// [partialeq]: cmp/trait.PartialEq.html
346+
/// [partialord]: cmp/trait.PartialOrd.html
347+
/// [eq]: cmp/trait.Eq.html
348+
/// [ord]: cmp/trait.Ord.html
349+
/// [hash]: hash/trait.Hash.html
350+
/// [asref]: convert/trait.AsRef.html
351+
/// [asmut]: convert/trait.AsMut.html
352+
/// [borrow]: borrow/trait.Borrow.html
353+
/// [borrowmut]: borrow/trait.BorrowMut.html
354+
/// [default]: default/trait.Default.html
355+
/// [replace]: mem/fn.replace.html
356+
/// [`IntoIterator`]: iter/trait.IntoIterator.html
357+
///
357358
#[stable(feature = "rust1", since = "1.0.0")]
358359
mod prim_array { }
359360

src/libstd/sys/redox/os.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,16 @@ use vec;
3333
const TMPBUF_SZ: usize = 128;
3434
static ENV_LOCK: Mutex = Mutex::new();
3535

36+
extern {
37+
#[link_name = "__errno_location"]
38+
fn errno_location() -> *mut i32;
39+
}
40+
3641
/// Returns the platform-specific value of errno
3742
pub fn errno() -> i32 {
38-
0
43+
unsafe {
44+
(*errno_location())
45+
}
3946
}
4047

4148
/// Gets a detailed string description for the given error number.

0 commit comments

Comments
 (0)