diff options
| author | bors <bors@rust-lang.org> | 2017-01-25 17:23:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-01-25 17:23:54 +0000 |
| commit | fc57e40ce703cb70a39249f5cfb661020a1549b6 (patch) | |
| tree | 60c257c4000f019544f94929faf63a2fcc48e56b /src/libstd | |
| parent | 1283c029557bcde106adde71f467fe133b3ffeff (diff) | |
| parent | a2fa75b70546baa160be2a00326fa1b08d699b4c (diff) | |
| download | rust-fc57e40ce703cb70a39249f5cfb661020a1549b6.tar.gz rust-fc57e40ce703cb70a39249f5cfb661020a1549b6.zip | |
Auto merge of #39296 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 6 pull requests - Successful merges: #38930, #39212, #39251, #39267, #39276, #39278 - Failed merges:
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/primitive_docs.rs | 43 | ||||
| -rw-r--r-- | src/libstd/sys/redox/os.rs | 9 |
2 files changed, 30 insertions, 22 deletions
diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index ce6ea2c1257..11197db98a3 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -272,7 +272,7 @@ mod prim_pointer { } /// Arrays of sizes from 0 to 32 (inclusive) implement the following traits if /// the element type allows it: /// -/// - [`Clone`][clone] (only if `T: Copy`) +/// - [`Clone`][clone] (only if `T: [Copy][copy]`) /// - [`Debug`][debug] /// - [`IntoIterator`][intoiterator] (implemented for `&[T; N]` and `&mut [T; N]`) /// - [`PartialEq`][partialeq], [`PartialOrd`][partialord], [`Eq`][eq], [`Ord`][ord] @@ -287,8 +287,8 @@ mod prim_pointer { } /// entirely different types. As a stopgap, trait implementations are /// statically generated up to size 32. /// -/// Arrays of *any* size are [`Copy`][copy] if the element type is `Copy`. This -/// works because the `Copy` trait is specially known to the compiler. +/// Arrays of *any* size are [`Copy`][copy] if the element type is [`Copy`][copy]. This +/// works because the [`Copy`][copy] trait is specially known to the compiler. /// /// Arrays coerce to [slices (`[T]`)][slice], so a slice method may be called on /// an array. Indeed, this provides most of the API for working with arrays. @@ -297,23 +297,6 @@ mod prim_pointer { } /// There is no way to move elements out of an array. See [`mem::replace`][replace] /// for an alternative. /// -/// [slice]: primitive.slice.html -/// [copy]: marker/trait.Copy.html -/// [clone]: clone/trait.Clone.html -/// [debug]: fmt/trait.Debug.html -/// [intoiterator]: iter/trait.IntoIterator.html -/// [partialeq]: cmp/trait.PartialEq.html -/// [partialord]: cmp/trait.PartialOrd.html -/// [eq]: cmp/trait.Eq.html -/// [ord]: cmp/trait.Ord.html -/// [hash]: hash/trait.Hash.html -/// [asref]: convert/trait.AsRef.html -/// [asmut]: convert/trait.AsMut.html -/// [borrow]: borrow/trait.Borrow.html -/// [borrowmut]: borrow/trait.BorrowMut.html -/// [default]: default/trait.Default.html -/// [replace]: mem/fn.replace.html -/// /// # Examples /// /// ``` @@ -347,13 +330,31 @@ mod prim_pointer { } /// ``` /// /// If the array has 32 or fewer elements (see above), you can also use the -/// array reference's `IntoIterator` implementation: +/// array reference's [`IntoIterator`] implementation: /// /// ``` /// # let array: [i32; 3] = [0; 3]; /// for x in &array { } /// ``` /// +/// [slice]: primitive.slice.html +/// [copy]: marker/trait.Copy.html +/// [clone]: clone/trait.Clone.html +/// [debug]: fmt/trait.Debug.html +/// [intoiterator]: iter/trait.IntoIterator.html +/// [partialeq]: cmp/trait.PartialEq.html +/// [partialord]: cmp/trait.PartialOrd.html +/// [eq]: cmp/trait.Eq.html +/// [ord]: cmp/trait.Ord.html +/// [hash]: hash/trait.Hash.html +/// [asref]: convert/trait.AsRef.html +/// [asmut]: convert/trait.AsMut.html +/// [borrow]: borrow/trait.Borrow.html +/// [borrowmut]: borrow/trait.BorrowMut.html +/// [default]: default/trait.Default.html +/// [replace]: mem/fn.replace.html +/// [`IntoIterator`]: iter/trait.IntoIterator.html +/// #[stable(feature = "rust1", since = "1.0.0")] mod prim_array { } diff --git a/src/libstd/sys/redox/os.rs b/src/libstd/sys/redox/os.rs index 135e972bca4..9d459581dd4 100644 --- a/src/libstd/sys/redox/os.rs +++ b/src/libstd/sys/redox/os.rs @@ -33,9 +33,16 @@ use vec; const TMPBUF_SZ: usize = 128; static ENV_LOCK: Mutex = Mutex::new(); +extern { + #[link_name = "__errno_location"] + fn errno_location() -> *mut i32; +} + /// Returns the platform-specific value of errno pub fn errno() -> i32 { - 0 + unsafe { + (*errno_location()) + } } /// Gets a detailed string description for the given error number. |
