]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/autoderef.rs
Fix #106496, suggest remove deref for type mismatch
[rust.git] / tests / ui / impl-trait / autoderef.rs
1 // check-pass
2
3 use std::path::Path;
4 use std::ffi::OsStr;
5 use std::ops::Deref;
6
7 fn frob(path: &str) -> impl Deref<Target = Path> + '_ {
8     OsStr::new(path).as_ref()
9 }
10
11 fn open_parent<'path>(_path: &'path Path) {
12     todo!()
13 }
14
15 fn main() {
16     let old_path = frob("hello");
17
18     open_parent(&old_path);
19 }