Skip to content

Commit 50da1eb

Browse files
authored
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".
1 parent 4a6547c commit 50da1eb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/std/src/env.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,9 @@ pub fn temp_dir() -> PathBuf {
616616
/// return the path of the symbolic link and other platforms will return the
617617
/// path of the symbolic link’s target.
618618
///
619+
/// If the executable is renamed while it is running, platforms may return the
620+
/// path at the time it was loaded instead of the new path.
621+
///
619622
/// # Errors
620623
///
621624
/// Acquiring the path of the current executable is a platform-specific operation

0 commit comments

Comments
 (0)