Skip to content

Commit 03b83a0

Browse files
committed
clarify docs for Args and ArgsOs
The args() and args_os() docs include a line about how the first element is usually the program name. Include that line in the struct docs too.
1 parent 6b76c9e commit 03b83a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libstd/env.rs

+8
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,10 @@ pub fn current_exe() -> io::Result<PathBuf> {
590590
///
591591
/// This structure is created through the [`std::env::args`] function.
592592
///
593+
/// The first element is traditionally the path of the executable, but it can be
594+
/// set to arbitrary text, and may not even exist. This means this property should
595+
/// not be relied upon for security purposes.
596+
///
593597
/// [`String`]: ../string/struct.String.html
594598
/// [`std::env::args`]: ./fn.args.html
595599
#[stable(feature = "env", since = "1.0.0")]
@@ -600,6 +604,10 @@ pub struct Args { inner: ArgsOs }
600604
///
601605
/// This structure is created through the [`std::env::args_os`] function.
602606
///
607+
/// The first element is traditionally the path of the executable, but it can be
608+
/// set to arbitrary text, and may not even exist. This means this property should
609+
/// not be relied upon for security purposes.
610+
///
603611
/// [`OsString`]: ../ffi/struct.OsString.html
604612
/// [`std::env::args_os`]: ./fn.args_os.html
605613
#[stable(feature = "env", since = "1.0.0")]

0 commit comments

Comments
 (0)