summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-4541.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-4541.rs')
-rw-r--r--tests/ui/issues/issue-4541.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-4541.rs b/tests/ui/issues/issue-4541.rs
new file mode 100644
index 000000000..e7f26d021
--- /dev/null
+++ b/tests/ui/issues/issue-4541.rs
@@ -0,0 +1,22 @@
+// run-pass
+
+fn parse_args() -> String {
+ let args: Vec<_> = ::std::env::args().collect();
+ let mut n = 0;
+
+ while n < args.len() {
+ match &*args[n] {
+ "-v" => (),
+ s => {
+ return s.to_string();
+ }
+ }
+ n += 1;
+ }
+
+ return "".to_string()
+}
+
+pub fn main() {
+ println!("{}", parse_args());
+}