diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-4541.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-4541.rs b/src/test/ui/issues/issue-4541.rs new file mode 100644 index 000000000..e7f26d021 --- /dev/null +++ b/src/test/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()); +} |