summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/autoderef.rs
blob: cd2cdd9e3b3cf8629b7fa86d8da38151c17bf569 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// revisions: current next
//[next] compile-flags: -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);
}