diff options
| author | bors <bors@rust-lang.org> | 2018-12-15 11:31:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-12-15 11:31:40 +0000 |
| commit | 0a1b2267e45ed0a5bdbfcbe522024729c8bd1387 (patch) | |
| tree | 5483e903347301b6bd9c38d3aa238a31218f80d3 /src/libstd | |
| parent | 747a5e514a2e235b21a609c365657fb9a0b725f4 (diff) | |
| parent | ae3882c206d817b7e68efcaa7ed10742f2e101f4 (diff) | |
| download | rust-0a1b2267e45ed0a5bdbfcbe522024729c8bd1387.tar.gz rust-0a1b2267e45ed0a5bdbfcbe522024729c8bd1387.zip | |
Auto merge of #56840 - pietroalbini:rollup, r=pietroalbini
Rollup of 14 pull requests Successful merges: - #56718 (Use libbacktrace pretty-printing) - #56725 (fix rust-lang/rust issue #50583) - #56731 (Add missing urls in ffi module docs) - #56738 (Fix private_no_mangle_fns message grammar) - #56746 (Add test of current behavior (infer free region within closure body)) - #56747 (target: remove Box returned by get_targets) - #56751 (Allow ptr::hash to accept fat pointers) - #56755 (Account for `impl Trait` when suggesting lifetime) - #56758 (Add short emoji status to toolstate updates) - #56760 (Deduplicate unsatisfied trait bounds) - #56769 (Add x86_64-unknown-uefi target) - #56792 (Bootstrap: Add testsuite for compiletest tool) - #56808 (Fixes broken links) - #56809 (Fix docs path to PermissionsExt) Failed merges: r? @ghost
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ffi/mod.rs | 28 | ||||
| -rw-r--r-- | src/libstd/fs.rs | 3 |
2 files changed, 17 insertions, 14 deletions
diff --git a/src/libstd/ffi/mod.rs b/src/libstd/ffi/mod.rs index f46c4f2938b..7e155396b8d 100644 --- a/src/libstd/ffi/mod.rs +++ b/src/libstd/ffi/mod.rs @@ -72,32 +72,32 @@ //! //! * **From Rust to C:** [`CString`] represents an owned, C-friendly //! string: it is nul-terminated, and has no internal nul characters. -//! Rust code can create a `CString` out of a normal string (provided +//! Rust code can create a [`CString`] out of a normal string (provided //! that the string doesn't have nul characters in the middle), and -//! then use a variety of methods to obtain a raw `*mut u8` that can +//! then use a variety of methods to obtain a raw `*mut `[`u8`] that can //! then be passed as an argument to functions which use the C //! conventions for strings. //! //! * **From C to Rust:** [`CStr`] represents a borrowed C string; it -//! is what you would use to wrap a raw `*const u8` that you got from -//! a C function. A `CStr` is guaranteed to be a nul-terminated array -//! of bytes. Once you have a `CStr`, you can convert it to a Rust -//! `&str` if it's valid UTF-8, or lossily convert it by adding +//! is what you would use to wrap a raw `*const `[`u8`] that you got from +//! a C function. A [`CStr`] is guaranteed to be a nul-terminated array +//! of bytes. Once you have a [`CStr`], you can convert it to a Rust +//! [`&str`][`str`] if it's valid UTF-8, or lossily convert it by adding //! replacement characters. //! //! [`OsString`] and [`OsStr`] are useful when you need to transfer //! strings to and from the operating system itself, or when capturing -//! the output of external commands. Conversions between `OsString`, -//! `OsStr` and Rust strings work similarly to those for [`CString`] +//! the output of external commands. Conversions between [`OsString`], +//! [`OsStr`] and Rust strings work similarly to those for [`CString`] //! and [`CStr`]. //! //! * [`OsString`] represents an owned string in whatever //! representation the operating system prefers. In the Rust standard //! library, various APIs that transfer strings to/from the operating -//! system use `OsString` instead of plain strings. For example, +//! system use [`OsString`] instead of plain strings. For example, //! [`env::var_os()`] is used to query environment variables; it -//! returns an `Option<OsString>`. If the environment variable exists -//! you will get a `Some(os_string)`, which you can *then* try to +//! returns an [`Option`]`<`[`OsString`]`>`. If the environment variable +//! exists you will get a [`Some`]`(os_string)`, which you can *then* try to //! convert to a Rust string. This yields a [`Result<>`], so that //! your code can detect errors in case the environment variable did //! not in fact contain valid Unicode data. @@ -105,7 +105,7 @@ //! * [`OsStr`] represents a borrowed reference to a string in a //! format that can be passed to the operating system. It can be //! converted into an UTF-8 Rust string slice in a similar way to -//! `OsString`. +//! [`OsString`]. //! //! # Conversions //! @@ -131,7 +131,7 @@ //! Additionally, on Windows [`OsString`] implements the //! `std::os::windows:ffi::`[`OsStringExt`][windows.OsStringExt] //! trait, which provides a [`from_wide`] method. The result of this -//! method is an `OsString` which can be round-tripped to a Windows +//! method is an [`OsString`] which can be round-tripped to a Windows //! string losslessly. //! //! [`String`]: ../string/struct.String.html @@ -160,6 +160,8 @@ //! [`collect`]: ../iter/trait.Iterator.html#method.collect //! [windows.OsStringExt]: ../os/windows/ffi/trait.OsStringExt.html //! [`from_wide`]: ../os/windows/ffi/trait.OsStringExt.html#tymethod.from_wide +//! [`Option`]: ../option/enum.Option.html +//! [`Some`]: ../option/enum.Option.html#variant.Some #![stable(feature = "rust1", since = "1.0.0")] diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index d581ba1de23..edcfdd9e534 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -195,9 +195,10 @@ pub struct OpenOptions(fs_imp::OpenOptions); /// This module only currently provides one bit of information, [`readonly`], /// which is exposed on all currently supported platforms. Unix-specific /// functionality, such as mode bits, is available through the -/// `os::unix::PermissionsExt` trait. +/// [`PermissionsExt`] trait. /// /// [`readonly`]: struct.Permissions.html#method.readonly +/// [`PermissionsExt`]: ../os/unix/fs/trait.PermissionsExt.html #[derive(Clone, PartialEq, Eq, Debug)] #[stable(feature = "rust1", since = "1.0.0")] pub struct Permissions(fs_imp::FilePermissions); |
