about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>2017-03-08 20:53:58 +0200
committerGitHub <noreply@github.com>2017-03-08 20:53:58 +0200
commit5070403f2d528e411f6a7702d7a69cb2bc775e76 (patch)
tree7f4c5ac5dc9037bc4b5ded91a89f9a5cfdd8597c /src/libstd
parent006c74432d82259802bdd17f206d7edddb3b64b8 (diff)
parent03b83a01add2167d81b57ff137359ec382d4dcf5 (diff)
downloadrust-5070403f2d528e411f6a7702d7a69cb2bc775e76.tar.gz
rust-5070403f2d528e411f6a7702d7a69cb2bc775e76.zip
Rollup merge of #40283 - oconnor663:args_docs, r=alexcrichton
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.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/env.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/env.rs b/src/libstd/env.rs
index dd4f1ff4f5e..64eb52e28bc 100644
--- a/src/libstd/env.rs
+++ b/src/libstd/env.rs
@@ -590,6 +590,10 @@ pub fn current_exe() -> io::Result<PathBuf> {
 ///
 /// This structure is created through the [`std::env::args`] function.
 ///
+/// The first element is traditionally the path of the executable, but it can be
+/// set to arbitrary text, and may not even exist. This means this property should
+/// not be relied upon for security purposes.
+///
 /// [`String`]: ../string/struct.String.html
 /// [`std::env::args`]: ./fn.args.html
 #[stable(feature = "env", since = "1.0.0")]
@@ -600,6 +604,10 @@ pub struct Args { inner: ArgsOs }
 ///
 /// This structure is created through the [`std::env::args_os`] function.
 ///
+/// The first element is traditionally the path of the executable, but it can be
+/// set to arbitrary text, and may not even exist. This means this property should
+/// not be relied upon for security purposes.
+///
 /// [`OsString`]: ../ffi/struct.OsString.html
 /// [`std::env::args_os`]: ./fn.args_os.html
 #[stable(feature = "env", since = "1.0.0")]