diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/type-alias-impl-trait/split-paths-may-dangle.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/type-alias-impl-trait/split-paths-may-dangle.rs b/tests/ui/type-alias-impl-trait/split-paths-may-dangle.rs new file mode 100644 index 00000000000..61c5342cdbb --- /dev/null +++ b/tests/ui/type-alias-impl-trait/split-paths-may-dangle.rs @@ -0,0 +1,11 @@ +// Regression test for issue #146045 - ensure that the TAIT `SplitPaths` does not +// require the borrowed string to be live. +//@ check-pass +//@ edition:2015 + +pub fn repro() -> Option<std::path::PathBuf> { + let unparsed = std::ffi::OsString::new(); + std::env::split_paths(&unparsed).next() +} + +fn main() {} |
