Skip to content

Commit fbc92f0

Browse files
committed
Add more syscall doc aliases to std docs
1 parent 6be93cc commit fbc92f0

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

library/std/src/fs.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,7 @@ pub fn remove_file<P: AsRef<Path>>(path: P) -> io::Result<()> {
19221922
/// Ok(())
19231923
/// }
19241924
/// ```
1925-
#[doc(alias = "stat")]
1925+
#[doc(alias = "stat", alias = "GetFileAttributes", alias = "GetFileAttributesEx")]
19261926
#[stable(feature = "rust1", since = "1.0.0")]
19271927
pub fn metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
19281928
fs_imp::stat(path.as_ref()).map(Metadata)
@@ -1957,7 +1957,7 @@ pub fn metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
19571957
/// Ok(())
19581958
/// }
19591959
/// ```
1960-
#[doc(alias = "lstat")]
1960+
#[doc(alias = "lstat", alias = "GetFileAttributes", alias = "GetFileAttributesEx")]
19611961
#[stable(feature = "symlink_metadata", since = "1.1.0")]
19621962
pub fn symlink_metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
19631963
fs_imp::lstat(path.as_ref()).map(Metadata)
@@ -2061,6 +2061,7 @@ pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()>
20612061
/// }
20622062
/// ```
20632063
#[doc(alias = "cp")]
2064+
#[doc(alias = "copy_file_range")]
20642065
#[doc(alias = "CopyFile", alias = "CopyFileEx")]
20652066
#[doc(alias = "fclonefileat", alias = "fcopyfile")]
20662067
#[stable(feature = "rust1", since = "1.0.0")]
@@ -2107,7 +2108,7 @@ pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<u64> {
21072108
/// Ok(())
21082109
/// }
21092110
/// ```
2110-
#[doc(alias = "CreateHardLink", alias = "linkat")]
2111+
#[doc(alias = "ln", alias = "CreateHardLink", alias = "linkat")]
21112112
#[stable(feature = "rust1", since = "1.0.0")]
21122113
pub fn hard_link<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io::Result<()> {
21132114
fs_imp::link(original.as_ref(), link.as_ref())
@@ -2303,6 +2304,7 @@ pub fn create_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
23032304
/// Ok(())
23042305
/// }
23052306
/// ```
2307+
#[doc(alias = "mkdir", alias = "CreateDirectory")]
23062308
#[stable(feature = "rust1", since = "1.0.0")]
23072309
pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
23082310
DirBuilder::new().recursive(true).create(path.as_ref())
@@ -2386,6 +2388,7 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
23862388
/// Ok(())
23872389
/// }
23882390
/// ```
2391+
#[doc(alias = "rm")]
23892392
#[stable(feature = "rust1", since = "1.0.0")]
23902393
pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
23912394
fs_imp::remove_dir_all(path.as_ref())

library/std/src/io/copy.rs

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ mod tests;
5757
/// Note that platform-specific behavior [may change in the future][changes].
5858
///
5959
/// [changes]: crate::io#platform-specific-behavior
60+
#[doc(alias = "copy_file_range", alias = "sendfile", alias = "splice")]
6061
#[stable(feature = "rust1", since = "1.0.0")]
6162
pub fn copy<R: ?Sized, W: ?Sized>(reader: &mut R, writer: &mut W) -> Result<u64>
6263
where

library/std/src/os/windows/fs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ impl FileTimesExt for fs::FileTimes {
577577
/// the process as an administrator.
578578
///
579579
/// [symlink-security]: https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links
580+
#[doc(alias = "CreateSymbolicLink", alias = "CreateSymbolicLinkW")]
580581
#[stable(feature = "symlink", since = "1.1.0")]
581582
pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io::Result<()> {
582583
sys::fs::symlink_inner(original.as_ref(), link.as_ref(), false)
@@ -616,6 +617,7 @@ pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io:
616617
/// the process as an administrator.
617618
///
618619
/// [symlink-security]: https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links
620+
#[doc(alias = "CreateSymbolicLink", alias = "CreateSymbolicLinkW")]
619621
#[stable(feature = "symlink", since = "1.1.0")]
620622
pub fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io::Result<()> {
621623
sys::fs::symlink_inner(original.as_ref(), link.as_ref(), true)

library/std/src/time.rs

+12
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ pub use core::time::TryFromFloatSecsError;
151151
/// [`checked_duration_since`]: Instant::checked_duration_since
152152
///
153153
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
154+
#[doc(alias = "insecure_time")]
155+
#[doc(alias = "clock_gettime")]
156+
#[doc(alias = "mach_absolute_time")]
157+
#[doc(alias = "get_tim")]
158+
#[doc(alias = "__wasi_clock_time_get")]
159+
#[doc(alias = "QueryPerformanceCounter")]
154160
#[stable(feature = "time2", since = "1.8.0")]
155161
#[cfg_attr(not(test), rustc_diagnostic_item = "Instant")]
156162
pub struct Instant(time::Instant);
@@ -244,6 +250,12 @@ pub struct Instant(time::Instant);
244250
///
245251
/// [`add`]: SystemTime::add
246252
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
253+
#[doc(alias = "insecure_time")]
254+
#[doc(alias = "clock_gettime")]
255+
#[doc(alias = "gettimeofday")]
256+
#[doc(alias = "SOLID_RTC_ReadTime")]
257+
#[doc(alias = "__wasi_clock_time_get")]
258+
#[doc(alias = "GetSystemTimePreciseAsFileTime")]
247259
#[stable(feature = "time2", since = "1.8.0")]
248260
pub struct SystemTime(time::SystemTime);
249261

0 commit comments

Comments
 (0)