diff options
Diffstat (limited to 'tests/ui/match/issue-74050-end-span.rs')
-rw-r--r-- | tests/ui/match/issue-74050-end-span.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/match/issue-74050-end-span.rs b/tests/ui/match/issue-74050-end-span.rs new file mode 100644 index 000000000..cc81214e2 --- /dev/null +++ b/tests/ui/match/issue-74050-end-span.rs @@ -0,0 +1,13 @@ +fn main() { + let mut args = std::env::args_os(); + let _arg = match args.next() { + Some(arg) => { + match arg.to_str() { + //~^ ERROR `arg` does not live long enough + Some(s) => s, + None => return, + } + } + None => return, + }; +} |