Fix intra-doc link resolution failure on re-exporting libstd
This commit is contained in:
parent
ef9a876f82
commit
ccb9dac5ed
13 changed files with 94 additions and 2 deletions
|
@ -37,6 +37,8 @@ extern "Rust" {
|
||||||
///
|
///
|
||||||
/// Note: while this type is unstable, the functionality it provides can be
|
/// Note: while this type is unstable, the functionality it provides can be
|
||||||
/// accessed through the [free functions in `alloc`](index.html#functions).
|
/// accessed through the [free functions in `alloc`](index.html#functions).
|
||||||
|
///
|
||||||
|
/// [`Alloc`]: trait.Alloc.html
|
||||||
#[unstable(feature = "allocator_api", issue = "32838")]
|
#[unstable(feature = "allocator_api", issue = "32838")]
|
||||||
#[derive(Copy, Clone, Default, Debug)]
|
#[derive(Copy, Clone, Default, Debug)]
|
||||||
pub struct Global;
|
pub struct Global;
|
||||||
|
@ -54,6 +56,10 @@ pub struct Global;
|
||||||
///
|
///
|
||||||
/// See [`GlobalAlloc::alloc`].
|
/// See [`GlobalAlloc::alloc`].
|
||||||
///
|
///
|
||||||
|
/// [`Global`]: struct.Global.html
|
||||||
|
/// [`Alloc`]: trait.Alloc.html
|
||||||
|
/// [`GlobalAlloc::alloc`]: trait.GlobalAlloc.html#tymethod.alloc
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -87,6 +93,10 @@ pub unsafe fn alloc(layout: Layout) -> *mut u8 {
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// See [`GlobalAlloc::dealloc`].
|
/// See [`GlobalAlloc::dealloc`].
|
||||||
|
///
|
||||||
|
/// [`Global`]: struct.Global.html
|
||||||
|
/// [`Alloc`]: trait.Alloc.html
|
||||||
|
/// [`GlobalAlloc::dealloc`]: trait.GlobalAlloc.html#tymethod.dealloc
|
||||||
#[stable(feature = "global_alloc", since = "1.28.0")]
|
#[stable(feature = "global_alloc", since = "1.28.0")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) {
|
pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) {
|
||||||
|
@ -105,6 +115,10 @@ pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) {
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// See [`GlobalAlloc::realloc`].
|
/// See [`GlobalAlloc::realloc`].
|
||||||
|
///
|
||||||
|
/// [`Global`]: struct.Global.html
|
||||||
|
/// [`Alloc`]: trait.Alloc.html
|
||||||
|
/// [`GlobalAlloc::realloc`]: trait.GlobalAlloc.html#method.realloc
|
||||||
#[stable(feature = "global_alloc", since = "1.28.0")]
|
#[stable(feature = "global_alloc", since = "1.28.0")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
|
pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
|
||||||
|
@ -124,6 +138,10 @@ pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
|
||||||
///
|
///
|
||||||
/// See [`GlobalAlloc::alloc_zeroed`].
|
/// See [`GlobalAlloc::alloc_zeroed`].
|
||||||
///
|
///
|
||||||
|
/// [`Global`]: struct.Global.html
|
||||||
|
/// [`Alloc`]: trait.Alloc.html
|
||||||
|
/// [`GlobalAlloc::alloc_zeroed`]: trait.GlobalAlloc.html#method.alloc_zeroed
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
|
|
@ -10,6 +10,8 @@ use crate::marker::{PhantomData, Unpin};
|
||||||
///
|
///
|
||||||
/// It consists of a data pointer and a [virtual function pointer table (vtable)][vtable] that
|
/// It consists of a data pointer and a [virtual function pointer table (vtable)][vtable] that
|
||||||
/// customizes the behavior of the `RawWaker`.
|
/// customizes the behavior of the `RawWaker`.
|
||||||
|
///
|
||||||
|
/// [`Waker`]: struct.Waker.html
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Debug)]
|
||||||
#[stable(feature = "futures_api", since = "1.36.0")]
|
#[stable(feature = "futures_api", since = "1.36.0")]
|
||||||
pub struct RawWaker {
|
pub struct RawWaker {
|
||||||
|
@ -55,6 +57,8 @@ impl RawWaker {
|
||||||
/// pointer of a properly constructed [`RawWaker`] object from inside the
|
/// pointer of a properly constructed [`RawWaker`] object from inside the
|
||||||
/// [`RawWaker`] implementation. Calling one of the contained functions using
|
/// [`RawWaker`] implementation. Calling one of the contained functions using
|
||||||
/// any other `data` pointer will cause undefined behavior.
|
/// any other `data` pointer will cause undefined behavior.
|
||||||
|
///
|
||||||
|
/// [`RawWaker`]: struct.RawWaker.html
|
||||||
#[stable(feature = "futures_api", since = "1.36.0")]
|
#[stable(feature = "futures_api", since = "1.36.0")]
|
||||||
#[derive(PartialEq, Copy, Clone, Debug)]
|
#[derive(PartialEq, Copy, Clone, Debug)]
|
||||||
pub struct RawWakerVTable {
|
pub struct RawWakerVTable {
|
||||||
|
@ -65,6 +69,9 @@ pub struct RawWakerVTable {
|
||||||
/// required for this additional instance of a [`RawWaker`] and associated
|
/// required for this additional instance of a [`RawWaker`] and associated
|
||||||
/// task. Calling `wake` on the resulting [`RawWaker`] should result in a wakeup
|
/// task. Calling `wake` on the resulting [`RawWaker`] should result in a wakeup
|
||||||
/// of the same task that would have been awoken by the original [`RawWaker`].
|
/// of the same task that would have been awoken by the original [`RawWaker`].
|
||||||
|
///
|
||||||
|
/// [`Waker`]: struct.Waker.html
|
||||||
|
/// [`RawWaker`]: struct.RawWaker.html
|
||||||
clone: unsafe fn(*const ()) -> RawWaker,
|
clone: unsafe fn(*const ()) -> RawWaker,
|
||||||
|
|
||||||
/// This function will be called when `wake` is called on the [`Waker`].
|
/// This function will be called when `wake` is called on the [`Waker`].
|
||||||
|
@ -73,6 +80,9 @@ pub struct RawWakerVTable {
|
||||||
/// The implementation of this function must make sure to release any
|
/// The implementation of this function must make sure to release any
|
||||||
/// resources that are associated with this instance of a [`RawWaker`] and
|
/// resources that are associated with this instance of a [`RawWaker`] and
|
||||||
/// associated task.
|
/// associated task.
|
||||||
|
///
|
||||||
|
/// [`Waker`]: struct.Waker.html
|
||||||
|
/// [`RawWaker`]: struct.RawWaker.html
|
||||||
wake: unsafe fn(*const ()),
|
wake: unsafe fn(*const ()),
|
||||||
|
|
||||||
/// This function will be called when `wake_by_ref` is called on the [`Waker`].
|
/// This function will be called when `wake_by_ref` is called on the [`Waker`].
|
||||||
|
@ -80,6 +90,9 @@ pub struct RawWakerVTable {
|
||||||
///
|
///
|
||||||
/// This function is similar to `wake`, but must not consume the provided data
|
/// This function is similar to `wake`, but must not consume the provided data
|
||||||
/// pointer.
|
/// pointer.
|
||||||
|
///
|
||||||
|
/// [`Waker`]: struct.Waker.html
|
||||||
|
/// [`RawWaker`]: struct.RawWaker.html
|
||||||
wake_by_ref: unsafe fn(*const ()),
|
wake_by_ref: unsafe fn(*const ()),
|
||||||
|
|
||||||
/// This function gets called when a [`RawWaker`] gets dropped.
|
/// This function gets called when a [`RawWaker`] gets dropped.
|
||||||
|
@ -87,6 +100,8 @@ pub struct RawWakerVTable {
|
||||||
/// The implementation of this function must make sure to release any
|
/// The implementation of this function must make sure to release any
|
||||||
/// resources that are associated with this instance of a [`RawWaker`] and
|
/// resources that are associated with this instance of a [`RawWaker`] and
|
||||||
/// associated task.
|
/// associated task.
|
||||||
|
///
|
||||||
|
/// [`RawWaker`]: struct.RawWaker.html
|
||||||
drop: unsafe fn(*const ()),
|
drop: unsafe fn(*const ()),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +143,9 @@ impl RawWakerVTable {
|
||||||
/// The implementation of this function must make sure to release any
|
/// The implementation of this function must make sure to release any
|
||||||
/// resources that are associated with this instance of a [`RawWaker`] and
|
/// resources that are associated with this instance of a [`RawWaker`] and
|
||||||
/// associated task.
|
/// associated task.
|
||||||
|
///
|
||||||
|
/// [`Waker`]: struct.Waker.html
|
||||||
|
/// [`RawWaker`]: struct.RawWaker.html
|
||||||
#[rustc_promotable]
|
#[rustc_promotable]
|
||||||
#[cfg_attr(stage0, unstable(feature = "futures_api_const_fn_ptr", issue = "50547"))]
|
#[cfg_attr(stage0, unstable(feature = "futures_api_const_fn_ptr", issue = "50547"))]
|
||||||
#[cfg_attr(not(stage0), stable(feature = "futures_api", since = "1.36.0"))]
|
#[cfg_attr(not(stage0), stable(feature = "futures_api", since = "1.36.0"))]
|
||||||
|
@ -201,6 +219,8 @@ impl fmt::Debug for Context<'_> {
|
||||||
/// executor-specific wakeup behavior.
|
/// executor-specific wakeup behavior.
|
||||||
///
|
///
|
||||||
/// Implements [`Clone`], [`Send`], and [`Sync`].
|
/// Implements [`Clone`], [`Send`], and [`Sync`].
|
||||||
|
///
|
||||||
|
/// [`RawWaker`]: struct.RawWaker.html
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[stable(feature = "futures_api", since = "1.36.0")]
|
#[stable(feature = "futures_api", since = "1.36.0")]
|
||||||
pub struct Waker {
|
pub struct Waker {
|
||||||
|
@ -266,6 +286,9 @@ impl Waker {
|
||||||
/// The behavior of the returned `Waker` is undefined if the contract defined
|
/// The behavior of the returned `Waker` is undefined if the contract defined
|
||||||
/// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld.
|
/// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld.
|
||||||
/// Therefore this method is unsafe.
|
/// Therefore this method is unsafe.
|
||||||
|
///
|
||||||
|
/// [`RawWaker`]: struct.RawWaker.html
|
||||||
|
/// [`RawWakerVTable`]: struct.RawWakerVTable.html
|
||||||
#[inline]
|
#[inline]
|
||||||
#[stable(feature = "futures_api", since = "1.36.0")]
|
#[stable(feature = "futures_api", since = "1.36.0")]
|
||||||
pub unsafe fn from_raw(waker: RawWaker) -> Waker {
|
pub unsafe fn from_raw(waker: RawWaker) -> Waker {
|
||||||
|
|
|
@ -173,6 +173,9 @@ static HOOK: AtomicPtr<()> = AtomicPtr::new(ptr::null_mut());
|
||||||
/// about the allocation that failed.
|
/// about the allocation that failed.
|
||||||
///
|
///
|
||||||
/// The allocation error hook is a global resource.
|
/// The allocation error hook is a global resource.
|
||||||
|
///
|
||||||
|
/// [`set_alloc_error_hook`]: fn.set_alloc_error_hook.html
|
||||||
|
/// [`take_alloc_error_hook`]: fn.take_alloc_error_hook.html
|
||||||
#[unstable(feature = "alloc_error_hook", issue = "51245")]
|
#[unstable(feature = "alloc_error_hook", issue = "51245")]
|
||||||
pub fn set_alloc_error_hook(hook: fn(Layout)) {
|
pub fn set_alloc_error_hook(hook: fn(Layout)) {
|
||||||
HOOK.store(hook as *mut (), Ordering::SeqCst);
|
HOOK.store(hook as *mut (), Ordering::SeqCst);
|
||||||
|
@ -183,6 +186,8 @@ pub fn set_alloc_error_hook(hook: fn(Layout)) {
|
||||||
/// *See also the function [`set_alloc_error_hook`].*
|
/// *See also the function [`set_alloc_error_hook`].*
|
||||||
///
|
///
|
||||||
/// If no custom hook is registered, the default hook will be returned.
|
/// If no custom hook is registered, the default hook will be returned.
|
||||||
|
///
|
||||||
|
/// [`set_alloc_error_hook`]: fn.set_alloc_error_hook.html
|
||||||
#[unstable(feature = "alloc_error_hook", issue = "51245")]
|
#[unstable(feature = "alloc_error_hook", issue = "51245")]
|
||||||
pub fn take_alloc_error_hook() -> fn(Layout) {
|
pub fn take_alloc_error_hook() -> fn(Layout) {
|
||||||
let hook = HOOK.swap(ptr::null_mut(), Ordering::SeqCst);
|
let hook = HOOK.swap(ptr::null_mut(), Ordering::SeqCst);
|
||||||
|
|
|
@ -2492,7 +2492,10 @@ impl DefaultHasher {
|
||||||
|
|
||||||
#[stable(feature = "hashmap_default_hasher", since = "1.13.0")]
|
#[stable(feature = "hashmap_default_hasher", since = "1.13.0")]
|
||||||
impl Default for DefaultHasher {
|
impl Default for DefaultHasher {
|
||||||
/// Creates a new `DefaultHasher` using [`new`][DefaultHasher::new].
|
// FIXME: here should link `new` to [DefaultHasher::new], but it occurs intra-doc link
|
||||||
|
// resolution failure when re-exporting libstd items. When #56922 fixed,
|
||||||
|
// link `new` to [DefaultHasher::new] again.
|
||||||
|
/// Creates a new `DefaultHasher` using `new`.
|
||||||
/// See its documentation for more.
|
/// See its documentation for more.
|
||||||
fn default() -> DefaultHasher {
|
fn default() -> DefaultHasher {
|
||||||
DefaultHasher::new()
|
DefaultHasher::new()
|
||||||
|
|
|
@ -207,6 +207,8 @@ pub trait Error: Debug + Display {
|
||||||
impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
|
impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
|
||||||
/// Converts a type of [`Error`] into a box of dyn [`Error`].
|
/// Converts a type of [`Error`] into a box of dyn [`Error`].
|
||||||
///
|
///
|
||||||
|
/// [`Error`]: ../error/trait.Error.html
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -244,6 +246,8 @@ impl<'a, E: Error + Send + Sync + 'a> From<E> for Box<dyn Error + Send + Sync +
|
||||||
/// Converts a type of [`Error`] + [`Send`] + [`Sync`] into a box of dyn [`Error`] +
|
/// Converts a type of [`Error`] + [`Send`] + [`Sync`] into a box of dyn [`Error`] +
|
||||||
/// [`Send`] + [`Sync`].
|
/// [`Send`] + [`Sync`].
|
||||||
///
|
///
|
||||||
|
/// [`Error`]: ../error/trait.Error.html
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -285,6 +289,8 @@ impl<'a, E: Error + Send + Sync + 'a> From<E> for Box<dyn Error + Send + Sync +
|
||||||
impl From<String> for Box<dyn Error + Send + Sync> {
|
impl From<String> for Box<dyn Error + Send + Sync> {
|
||||||
/// Converts a [`String`] into a box of dyn [`Error`] + [`Send`] + [`Sync`].
|
/// Converts a [`String`] into a box of dyn [`Error`] + [`Send`] + [`Sync`].
|
||||||
///
|
///
|
||||||
|
/// [`Error`]: ../error/trait.Error.html
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -318,6 +324,8 @@ impl From<String> for Box<dyn Error + Send + Sync> {
|
||||||
impl From<String> for Box<dyn Error> {
|
impl From<String> for Box<dyn Error> {
|
||||||
/// Converts a [`String`] into a box of dyn [`Error`].
|
/// Converts a [`String`] into a box of dyn [`Error`].
|
||||||
///
|
///
|
||||||
|
/// [`Error`]: ../error/trait.Error.html
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -339,6 +347,8 @@ impl From<String> for Box<dyn Error> {
|
||||||
impl<'a> From<&str> for Box<dyn Error + Send + Sync + 'a> {
|
impl<'a> From<&str> for Box<dyn Error + Send + Sync + 'a> {
|
||||||
/// Converts a [`str`] into a box of dyn [`Error`] + [`Send`] + [`Sync`].
|
/// Converts a [`str`] into a box of dyn [`Error`] + [`Send`] + [`Sync`].
|
||||||
///
|
///
|
||||||
|
/// [`Error`]: ../error/trait.Error.html
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -359,6 +369,8 @@ impl<'a> From<&str> for Box<dyn Error + Send + Sync + 'a> {
|
||||||
impl From<&str> for Box<dyn Error> {
|
impl From<&str> for Box<dyn Error> {
|
||||||
/// Converts a [`str`] into a box of dyn [`Error`].
|
/// Converts a [`str`] into a box of dyn [`Error`].
|
||||||
///
|
///
|
||||||
|
/// [`Error`]: ../error/trait.Error.html
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -378,6 +390,9 @@ impl From<&str> for Box<dyn Error> {
|
||||||
impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + Send + Sync + 'a> {
|
impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + Send + Sync + 'a> {
|
||||||
/// Converts a [`Cow`] into a box of dyn [`Error`] + [`Send`] + [`Sync`].
|
/// Converts a [`Cow`] into a box of dyn [`Error`] + [`Send`] + [`Sync`].
|
||||||
///
|
///
|
||||||
|
/// [`Cow`]: ../borrow/enum.Cow.html
|
||||||
|
/// [`Error`]: ../error/trait.Error.html
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -399,6 +414,9 @@ impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + Send + Sync + 'a> {
|
||||||
impl<'a> From<Cow<'a, str>> for Box<dyn Error> {
|
impl<'a> From<Cow<'a, str>> for Box<dyn Error> {
|
||||||
/// Converts a [`Cow`] into a box of dyn [`Error`].
|
/// Converts a [`Cow`] into a box of dyn [`Error`].
|
||||||
///
|
///
|
||||||
|
/// [`Cow`]: ../borrow/enum.Cow.html
|
||||||
|
/// [`Error`]: ../error/trait.Error.html
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
|
|
@ -351,6 +351,8 @@ impl From<String> for OsString {
|
||||||
/// Converts a [`String`] into a [`OsString`].
|
/// Converts a [`String`] into a [`OsString`].
|
||||||
///
|
///
|
||||||
/// The conversion copies the data, and includes an allocation on the heap.
|
/// The conversion copies the data, and includes an allocation on the heap.
|
||||||
|
///
|
||||||
|
/// [`OsString`]: ../../std/ffi/struct.OsString.html
|
||||||
fn from(s: String) -> OsString {
|
fn from(s: String) -> OsString {
|
||||||
OsString { inner: Buf::from_string(s) }
|
OsString { inner: Buf::from_string(s) }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1812,6 +1812,8 @@ pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
|
||||||
/// function.)
|
/// function.)
|
||||||
/// * `path` already exists.
|
/// * `path` already exists.
|
||||||
///
|
///
|
||||||
|
/// [`create_dir_all`]: fn.create_dir_all.html
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
|
|
|
@ -754,7 +754,7 @@ impl<W> fmt::Display for IntoInnerError<W> {
|
||||||
/// completed, rather than the entire buffer at once. Enter `LineWriter`. It
|
/// completed, rather than the entire buffer at once. Enter `LineWriter`. It
|
||||||
/// does exactly that.
|
/// does exactly that.
|
||||||
///
|
///
|
||||||
/// Like [`BufWriter`], a `LineWriter`’s buffer will also be flushed when the
|
/// Like [`BufWriter`][bufwriter], a `LineWriter`’s buffer will also be flushed when the
|
||||||
/// `LineWriter` goes out of scope or when its internal buffer is full.
|
/// `LineWriter` goes out of scope or when its internal buffer is full.
|
||||||
///
|
///
|
||||||
/// [bufwriter]: struct.BufWriter.html
|
/// [bufwriter]: struct.BufWriter.html
|
||||||
|
|
|
@ -546,6 +546,9 @@ impl FromInner<c::sockaddr_in6> for SocketAddrV6 {
|
||||||
#[stable(feature = "ip_from_ip", since = "1.16.0")]
|
#[stable(feature = "ip_from_ip", since = "1.16.0")]
|
||||||
impl From<SocketAddrV4> for SocketAddr {
|
impl From<SocketAddrV4> for SocketAddr {
|
||||||
/// Converts a [`SocketAddrV4`] into a [`SocketAddr::V4`].
|
/// Converts a [`SocketAddrV4`] into a [`SocketAddr::V4`].
|
||||||
|
///
|
||||||
|
/// [`SocketAddrV4`]: ../../std/net/struct.SocketAddrV4.html
|
||||||
|
/// [`SocketAddr::V4`]: ../../std/net/enum.SocketAddr.html#variant.V4
|
||||||
fn from(sock4: SocketAddrV4) -> SocketAddr {
|
fn from(sock4: SocketAddrV4) -> SocketAddr {
|
||||||
SocketAddr::V4(sock4)
|
SocketAddr::V4(sock4)
|
||||||
}
|
}
|
||||||
|
@ -554,6 +557,9 @@ impl From<SocketAddrV4> for SocketAddr {
|
||||||
#[stable(feature = "ip_from_ip", since = "1.16.0")]
|
#[stable(feature = "ip_from_ip", since = "1.16.0")]
|
||||||
impl From<SocketAddrV6> for SocketAddr {
|
impl From<SocketAddrV6> for SocketAddr {
|
||||||
/// Converts a [`SocketAddrV6`] into a [`SocketAddr::V6`].
|
/// Converts a [`SocketAddrV6`] into a [`SocketAddr::V6`].
|
||||||
|
///
|
||||||
|
/// [`SocketAddrV6`]: ../../std/net/struct.SocketAddrV6.html
|
||||||
|
/// [`SocketAddr::V6`]: ../../std/net/enum.SocketAddr.html#variant.V6
|
||||||
fn from(sock6: SocketAddrV6) -> SocketAddr {
|
fn from(sock6: SocketAddrV6) -> SocketAddr {
|
||||||
SocketAddr::V6(sock6)
|
SocketAddr::V6(sock6)
|
||||||
}
|
}
|
||||||
|
@ -567,6 +573,13 @@ impl<I: Into<IpAddr>> From<(I, u16)> for SocketAddr {
|
||||||
/// and creates a [`SocketAddr::V6`] for a [`IpAddr::V6`].
|
/// and creates a [`SocketAddr::V6`] for a [`IpAddr::V6`].
|
||||||
///
|
///
|
||||||
/// `u16` is treated as port of the newly created [`SocketAddr`].
|
/// `u16` is treated as port of the newly created [`SocketAddr`].
|
||||||
|
///
|
||||||
|
/// [`IpAddr`]: ../../std/net/enum.IpAddr.html
|
||||||
|
/// [`IpAddr::V4`]: ../../std/net/enum.IpAddr.html#variant.V4
|
||||||
|
/// [`IpAddr::V6`]: ../../std/net/enum.IpAddr.html#variant.V6
|
||||||
|
/// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
|
||||||
|
/// [`SocketAddr::V4`]: ../../std/net/enum.SocketAddr.html#variant.V4
|
||||||
|
/// [`SocketAddr::V6`]: ../../std/net/enum.SocketAddr.html#variant.V6
|
||||||
fn from(pieces: (I, u16)) -> SocketAddr {
|
fn from(pieces: (I, u16)) -> SocketAddr {
|
||||||
SocketAddr::new(pieces.0.into(), pieces.1)
|
SocketAddr::new(pieces.0.into(), pieces.1)
|
||||||
}
|
}
|
||||||
|
|
|
@ -376,6 +376,8 @@ unsafe impl<#[may_dangle] T: ?Sized> Drop for Mutex<T> {
|
||||||
impl<T> From<T> for Mutex<T> {
|
impl<T> From<T> for Mutex<T> {
|
||||||
/// Creates a new mutex in an unlocked state ready for use.
|
/// Creates a new mutex in an unlocked state ready for use.
|
||||||
/// This is equivalent to [`Mutex::new`].
|
/// This is equivalent to [`Mutex::new`].
|
||||||
|
///
|
||||||
|
/// [`Mutex::new`]: ../../std/sync/struct.Mutex.html#method.new
|
||||||
fn from(t: T) -> Self {
|
fn from(t: T) -> Self {
|
||||||
Mutex::new(t)
|
Mutex::new(t)
|
||||||
}
|
}
|
||||||
|
|
|
@ -453,6 +453,8 @@ impl<T: Default> Default for RwLock<T> {
|
||||||
impl<T> From<T> for RwLock<T> {
|
impl<T> From<T> for RwLock<T> {
|
||||||
/// Creates a new instance of an `RwLock<T>` which is unlocked.
|
/// Creates a new instance of an `RwLock<T>` which is unlocked.
|
||||||
/// This is equivalent to [`RwLock::new`].
|
/// This is equivalent to [`RwLock::new`].
|
||||||
|
///
|
||||||
|
/// [`RwLock::new`]: ../../std/sync/struct.RwLock.html#method.new
|
||||||
fn from(t: T) -> Self {
|
fn from(t: T) -> Self {
|
||||||
RwLock::new(t)
|
RwLock::new(t)
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,6 +443,7 @@ impl Builder {
|
||||||
/// [`Builder::spawn`]: ../../std/thread/struct.Builder.html#method.spawn
|
/// [`Builder::spawn`]: ../../std/thread/struct.Builder.html#method.spawn
|
||||||
/// [`io::Result`]: ../../std/io/type.Result.html
|
/// [`io::Result`]: ../../std/io/type.Result.html
|
||||||
/// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html
|
/// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html
|
||||||
|
/// [`JoinHandle::join`]: ../../std/thread/struct.JoinHandle.html#method.join
|
||||||
#[unstable(feature = "thread_spawn_unchecked", issue = "55132")]
|
#[unstable(feature = "thread_spawn_unchecked", issue = "55132")]
|
||||||
pub unsafe fn spawn_unchecked<'a, F, T>(self, f: F) -> io::Result<JoinHandle<T>> where
|
pub unsafe fn spawn_unchecked<'a, F, T>(self, f: F) -> io::Result<JoinHandle<T>> where
|
||||||
F: FnOnce() -> T, F: Send + 'a, T: Send + 'a
|
F: FnOnce() -> T, F: Send + 'a, T: Send + 'a
|
||||||
|
|
3
src/test/rustdoc/intra-link-libstd-re-export.rs
Normal file
3
src/test/rustdoc/intra-link-libstd-re-export.rs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#![deny(intra_doc_link_resolution_failure)]
|
||||||
|
|
||||||
|
pub use std::*;
|
Loading…
Add table
Add a link
Reference in a new issue