Skip to content

Commit cd20fbd

Browse files
authored
Rollup merge of #88394 - ChrisDenton:patch-1, r=joshtriplett
Document `std::env::current_exe` possible rename behaviour It might not be obvious that the "path of the current running executable" may (or may not) imply "at the time it was loaded". This came up recently in chat so I thought it might be worth documenting.
2 parents d4f263a + 50da1eb commit cd20fbd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/std/src/env.rs

+3
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)