about summary refs log tree commit diff
path: root/library/std/src/env.rs
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-28 20:41:52 +0200
committerGitHub <noreply@github.com>2022-03-28 20:41:52 +0200
commit4c8bc046b9ca828784cf9d6d48bbabb28c2ec7ec (patch)
treeedd187e3f26184f9aedf4adfa8eb7d264688dd31 /library/std/src/env.rs
parentce319ac1a2a6af741cb7c4b574c7d0d730f899c4 (diff)
parentd55854d484f64e7a2b570e28ff1250112b6578e2 (diff)
Rollup merge of #95397 - dtolnay:disclaimer, r=m-ou-se
Link to std::io's platform-specific behavior disclaimer

This PR adds some links in standard library documentation to point to https://doc.rust-lang.org/std/io/index.html#platform-specific-behavior.

> ### Platform-specific behavior
>
> Many I/O functions throughout the standard library are documented to indicate what various library or syscalls they are delegated to. This is done to help applications both understand what’s happening under the hood as well as investigate any possibly unclear semantics. Note, however, that this is informative, not a binding contract. The implementation of many of these functions are subject to change over time and may call fewer or more syscalls/library functions.

Many of the `std::fs` APIs already link to this disclaimer when discussing system calls.
Diffstat (limited to 'library/std/src/env.rs')
-rw-r--r--library/std/src/env.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs
index 05f08c498e6..f03d298d869 100644
--- a/library/std/src/env.rs
+++ b/library/std/src/env.rs
@@ -25,9 +25,11 @@ use crate::sys::os as os_imp;
 ///
 /// # Platform-specific behavior
 ///
-/// This function currently corresponds to the `getcwd` function on Unix
+/// This function [currently] corresponds to the `getcwd` function on Unix
 /// and the `GetCurrentDirectoryW` function on Windows.
 ///
+/// [currently]: crate::io#platform-specific-behavior
+///
 /// # Errors
 ///
 /// Returns an [`Err`] if the current working directory value is invalid.
@@ -56,11 +58,13 @@ pub fn current_dir() -> io::Result<PathBuf> {
 ///
 /// # Platform-specific behavior
 ///
-/// This function currently corresponds to the `chdir` function on Unix
+/// This function [currently] corresponds to the `chdir` function on Unix
 /// and the `SetCurrentDirectoryW` function on Windows.
 ///
 /// Returns an [`Err`] if the operation fails.
 ///
+/// [currently]: crate::io#platform-specific-behavior
+///
 /// # Examples
 ///
 /// ```