diff options
Diffstat (limited to 'tests/ui/impl-trait/autoderef.rs')
-rw-r--r-- | tests/ui/impl-trait/autoderef.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/autoderef.rs b/tests/ui/impl-trait/autoderef.rs new file mode 100644 index 000000000..5e4f49954 --- /dev/null +++ b/tests/ui/impl-trait/autoderef.rs @@ -0,0 +1,19 @@ +// check-pass + +use std::path::Path; +use std::ffi::OsStr; +use std::ops::Deref; + +fn frob(path: &str) -> impl Deref<Target = Path> + '_ { + OsStr::new(path).as_ref() +} + +fn open_parent<'path>(_path: &'path Path) { + todo!() +} + +fn main() { + let old_path = frob("hello"); + + open_parent(&old_path); +} |