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".
This commit is contained in:
Chris Denton 2021-08-27 14:25:29 +01:00 committed by GitHub
parent 4a6547cca6
commit 50da1eb1cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 links 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