Skip to content

Commit 0a96e08

Browse files
committed
Switch to intra-doc links in /sys/windows/ext/{ffi,fs,process}.rs
1 parent 7a4fb35 commit 0a96e08

File tree

3 files changed

+8
-34
lines changed

3 files changed

+8
-34
lines changed

library/std/src/sys/windows/ext/ffi.rs

+6-21
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
//! [`OsString`] is the Rust wrapper for owned strings in the
3131
//! preferred representation of the operating system. On Windows,
3232
//! this struct gets augmented with an implementation of the
33-
//! [`OsStringExt`] trait, which has a [`from_wide`] method. This
33+
//! [`OsStringExt`] trait, which has a [`OsStringExt::from_wide`] method. This
3434
//! lets you create an [`OsString`] from a `&[u16]` slice; presumably
3535
//! you get such a slice out of a `WCHAR` Windows API.
3636
//!
3737
//! Similarly, [`OsStr`] is the Rust wrapper for borrowed strings from
3838
//! preferred representation of the operating system. On Windows, the
39-
//! [`OsStrExt`] trait provides the [`encode_wide`] method, which
39+
//! [`OsStrExt`] trait provides the [`OsStrExt::encode_wide`] method, which
4040
//! outputs an [`EncodeWide`] iterator. You can [`collect`] this
4141
//! iterator, for example, to obtain a `Vec<u16>`; you can later get a
4242
//! pointer to this vector's contents and feed it to Windows APIs.
@@ -47,15 +47,8 @@
4747
//! ill-formed UTF-16.
4848
//!
4949
//! [ill-formed-utf-16]: https://simonsapin.github.io/wtf-8/#ill-formed-utf-16
50-
//! [`OsString`]: ../../../ffi/struct.OsString.html
51-
//! [`OsStr`]: ../../../ffi/struct.OsStr.html
52-
//! [`OsStringExt`]: trait.OsStringExt.html
53-
//! [`OsStrExt`]: trait.OsStrExt.html
54-
//! [`EncodeWide`]: struct.EncodeWide.html
55-
//! [`from_wide`]: trait.OsStringExt.html#tymethod.from_wide
56-
//! [`encode_wide`]: trait.OsStrExt.html#tymethod.encode_wide
57-
//! [`collect`]: ../../../iter/trait.Iterator.html#method.collect
58-
//! [U+FFFD]: ../../../char/constant.REPLACEMENT_CHARACTER.html
50+
//! [`collect`]: crate::iter::Iterator::collect
51+
//! [U+FFFD]: crate::char::REPLACEMENT_CHARACTER
5952
6053
#![stable(feature = "rust1", since = "1.0.0")]
6154

@@ -68,14 +61,12 @@ use crate::sys_common::{AsInner, FromInner};
6861
pub use crate::sys_common::wtf8::EncodeWide;
6962

7063
/// Windows-specific extensions to [`OsString`].
71-
///
72-
/// [`OsString`]: ../../../../std/ffi/struct.OsString.html
7364
#[stable(feature = "rust1", since = "1.0.0")]
7465
pub trait OsStringExt {
7566
/// Creates an `OsString` from a potentially ill-formed UTF-16 slice of
7667
/// 16-bit code units.
7768
///
78-
/// This is lossless: calling [`encode_wide`] on the resulting string
69+
/// This is lossless: calling [`OsStrExt::encode_wide`] on the resulting string
7970
/// will always return the original code units.
8071
///
8172
/// # Examples
@@ -89,8 +80,6 @@ pub trait OsStringExt {
8980
///
9081
/// let string = OsString::from_wide(&source[..]);
9182
/// ```
92-
///
93-
/// [`encode_wide`]: ./trait.OsStrExt.html#tymethod.encode_wide
9483
#[stable(feature = "rust1", since = "1.0.0")]
9584
fn from_wide(wide: &[u16]) -> Self;
9685
}
@@ -103,14 +92,12 @@ impl OsStringExt for OsString {
10392
}
10493

10594
/// Windows-specific extensions to [`OsStr`].
106-
///
107-
/// [`OsStr`]: ../../../../std/ffi/struct.OsStr.html
10895
#[stable(feature = "rust1", since = "1.0.0")]
10996
pub trait OsStrExt {
11097
/// Re-encodes an `OsStr` as a wide character sequence, i.e., potentially
11198
/// ill-formed UTF-16.
11299
///
113-
/// This is lossless: calling [`OsString::from_wide`] and then
100+
/// This is lossless: calling [`OsStringExt::from_wide`] and then
114101
/// `encode_wide` on the result will yield the original code units.
115102
/// Note that the encoding does not add a final null terminator.
116103
///
@@ -128,8 +115,6 @@ pub trait OsStrExt {
128115
/// let result: Vec<u16> = string.encode_wide().collect();
129116
/// assert_eq!(&source[..], &result[..]);
130117
/// ```
131-
///
132-
/// [`OsString::from_wide`]: ./trait.OsStringExt.html#tymethod.from_wide
133118
#[stable(feature = "rust1", since = "1.0.0")]
134119
fn encode_wide(&self) -> EncodeWide<'_>;
135120
}

library/std/src/sys/windows/ext/fs.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ use crate::path::Path;
88
use crate::sys;
99
use crate::sys_common::{AsInner, AsInnerMut};
1010

11-
/// Windows-specific extensions to [`File`].
12-
///
13-
/// [`File`]: ../../../fs/struct.File.html
11+
/// Windows-specific extensions to [`fs::File`].
1412
#[stable(feature = "file_offset", since = "1.15.0")]
1513
pub trait FileExt {
1614
/// Seeks to a given position and reads a number of bytes.
@@ -94,8 +92,6 @@ impl FileExt for fs::File {
9492
}
9593

9694
/// Windows-specific extensions to [`fs::OpenOptions`].
97-
///
98-
/// [`fs::OpenOptions`]: ../../../../std/fs/struct.OpenOptions.html
9995
#[stable(feature = "open_options_ext", since = "1.10.0")]
10096
pub trait OpenOptionsExt {
10197
/// Overrides the `dwDesiredAccess` argument to the call to [`CreateFile`]
@@ -295,7 +291,6 @@ impl OpenOptionsExt for OpenOptions {
295291
/// The data members that this trait exposes correspond to the members
296292
/// of the [`BY_HANDLE_FILE_INFORMATION`] structure.
297293
///
298-
/// [`fs::Metadata`]: ../../../../std/fs/struct.Metadata.html
299294
/// [`BY_HANDLE_FILE_INFORMATION`]:
300295
/// https://docs.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information
301296
#[stable(feature = "metadata_ext", since = "1.1.0")]
@@ -499,11 +494,9 @@ impl MetadataExt for Metadata {
499494
}
500495
}
501496

502-
/// Windows-specific extensions to [`FileType`].
497+
/// Windows-specific extensions to [`fs::FileType`].
503498
///
504499
/// On Windows, a symbolic link knows whether it is a file or directory.
505-
///
506-
/// [`FileType`]: ../../../../std/fs/struct.FileType.html
507500
#[unstable(feature = "windows_file_type_ext", issue = "none")]
508501
pub trait FileTypeExt {
509502
/// Returns `true` if this file type is a symbolic link that is also a directory.

library/std/src/sys/windows/ext/process.rs

-4
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ impl IntoRawHandle for process::ChildStderr {
7373
}
7474

7575
/// Windows-specific extensions to [`process::ExitStatus`].
76-
///
77-
/// [`process::ExitStatus`]: ../../../../std/process/struct.ExitStatus.html
7876
#[stable(feature = "exit_status_from", since = "1.12.0")]
7977
pub trait ExitStatusExt {
8078
/// Creates a new `ExitStatus` from the raw underlying `u32` return value of
@@ -91,8 +89,6 @@ impl ExitStatusExt for process::ExitStatus {
9189
}
9290

9391
/// Windows-specific extensions to the [`process::Command`] builder.
94-
///
95-
/// [`process::Command`]: ../../../../std/process/struct.Command.html
9692
#[stable(feature = "windows_process_extensions", since = "1.16.0")]
9793
pub trait CommandExt {
9894
/// Sets the [process creation flags][1] to be passed to `CreateProcess`.

0 commit comments

Comments
 (0)