about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-02-24 19:21:46 -0500
committerGitHub <noreply@github.com>2025-02-24 19:21:46 -0500
commit1cd083d73f62981ba0da29a3af6f43e76590be3c (patch)
tree52dc1d4ded7b7680b1a4abe17a5648dbf0bcb4c1 /library/std/src
parent0bb00e2085b169bfc21e58b299f67f44c906d2fa (diff)
parent0d4d752e83f664c8e9b135e3e180084bb0b09a39 (diff)
downloadrust-1cd083d73f62981ba0da29a3af6f43e76590be3c.tar.gz
rust-1cd083d73f62981ba0da29a3af6f43e76590be3c.zip
Rollup merge of #137321 - aviraxp:patch-1, r=cuviper
Correct doc about `temp_dir()` behavior on Android

Since commit https://github.com/aosp-mirror/platform_frameworks_base/commit/d5ccb038f69193fb63b5169d7adc5da19859c9d8, `TMPDIR` will be set to application's cache dir when app starts.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/env.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs
index adbd6889624..4a071b4e1fa 100644
--- a/library/std/src/env.rs
+++ b/library/std/src/env.rs
@@ -668,7 +668,9 @@ pub fn home_dir() -> Option<PathBuf> {
 /// On Unix, returns the value of the `TMPDIR` environment variable if it is
 /// set, otherwise the value is OS-specific:
 /// - On Android, there is no global temporary folder (it is usually allocated
-///   per-app), it returns `/data/local/tmp`.
+///   per-app), it will return the application's cache dir if the program runs
+///   in application's namespace and system version is Android 13 (or above), or
+///   `/data/local/tmp` otherwise.
 /// - On Darwin-based OSes (macOS, iOS, etc) it returns the directory provided
 ///   by `confstr(_CS_DARWIN_USER_TEMP_DIR, ...)`, as recommended by [Apple's
 ///   security guidelines][appledoc].