rust/tests/ui/impl-trait/autoderef.rs
2023-05-27 17:37:16 +00:00

22 lines
374 B
Rust

// revisions: current next
//[next] compile-flag: -Ztrait-solver=next
// 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);
}