]> git.proxmox.com Git - rustc.git/blob - src/test/rustdoc/deref-recursive-pathbuf.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / rustdoc / deref-recursive-pathbuf.rs
1 // #26207: Show all methods reachable via Deref impls, recursing through multiple dereferencing
2 // levels and across multiple crates.
3 // For `Deref` on non-foreign types, look at `deref-recursive.rs`.
4
5 // @has 'foo/struct.Foo.html'
6 // @has '-' '//*[@id="deref-methods-PathBuf"]' 'Methods from Deref<Target = PathBuf>'
7 // @has '-' '//*[@class="impl-items"]//*[@id="method.as_path"]' 'pub fn as_path(&self)'
8 // @has '-' '//*[@id="deref-methods-Path"]' 'Methods from Deref<Target = Path>'
9 // @has '-' '//*[@class="impl-items"]//*[@id="method.exists"]' 'pub fn exists(&self)'
10 // @has '-' '//*[@class="sidebar-title"]/a[@href="#deref-methods-PathBuf"]' 'Methods from Deref<Target=PathBuf>'
11 // @has '-' '//*[@class="sidebar-elems"]//*[@class="block"]//a[@href="#method.as_path"]' 'as_path'
12 // @has '-' '//*[@class="sidebar-title"]/a[@href="#deref-methods-Path"]' 'Methods from Deref<Target=Path>'
13 // @has '-' '//*[@class="sidebar-elems"]//*[@class="block"]//a[@href="#method.exists"]' 'exists'
14
15 #![crate_name = "foo"]
16
17 use std::ops::Deref;
18 use std::path::PathBuf;
19
20 pub struct Foo(PathBuf);
21
22 impl Deref for Foo {
23 type Target = PathBuf;
24 fn deref(&self) -> &PathBuf { &self.0 }
25 }