rust/tests/ui/impl-trait/autoderef.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
369 B
Rust
Raw Normal View History

// revisions: current next
2023-12-14 12:11:28 +00:00
//[next] compile-flags: -Znext-solver
// 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);
}