diff options
| author | Chris Denton <ChrisDenton@users.noreply.github.com> | 2021-08-27 14:25:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-27 14:25:29 +0100 |
| commit | 50da1eb1cddb6a6735d3601751f300d0773be65e (patch) | |
| tree | 20188b4b64f8f1888fe192000b2c69953e2f1079 | |
| parent | 4a6547cca6d2b2f465f01331927855734687b527 (diff) | |
| download | rust-50da1eb1cddb6a6735d3601751f300d0773be65e.tar.gz rust-50da1eb1cddb6a6735d3601751f300d0773be65e.zip | |
Document `std::env::current_exe` rename behaviour
It might not be obvious that the "path of the current running executable" may (or may not) mean "at the time it was loaded".
| -rw-r--r-- | library/std/src/env.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/env.rs b/library/std/src/env.rs index a7465200955..e343073d215 100644 --- a/library/std/src/env.rs +++ b/library/std/src/env.rs @@ -616,6 +616,9 @@ pub fn temp_dir() -> PathBuf { /// return the path of the symbolic link and other platforms will return the /// path of the symbolic link’s target. /// +/// If the executable is renamed while it is running, platforms may return the +/// path at the time it was loaded instead of the new path. +/// /// # Errors /// /// Acquiring the path of the current executable is a platform-specific operation |
