1 // ignore-tidy-linelength
3 // #26207: Show all methods reachable via Deref impls, recursing through multiple dereferencing
4 // levels and across multiple crates.
6 // @has 'foo/struct.Foo.html'
7 // @has '-' '//*[@id="deref-methods-PathBuf"]' 'Methods from Deref<Target = PathBuf>'
8 // @has '-' '//*[@class="impl-items"]//*[@id="method.as_path"]' 'pub fn as_path(&self)'
9 // @has '-' '//*[@id="deref-methods-Path"]' 'Methods from Deref<Target = Path>'
10 // @has '-' '//*[@class="impl-items"]//*[@id="method.exists"]' 'pub fn exists(&self)'
11 // @has '-' '//*[@class="sidebar-title"][@href="#deref-methods-PathBuf"]' 'Methods from Deref<Target=PathBuf>'
12 // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.as_path"]' 'as_path'
13 // @has '-' '//*[@class="sidebar-title"][@href="#deref-methods-Path"]' 'Methods from Deref<Target=Path>'
14 // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.exists"]' 'exists'
16 #![crate_name = "foo"]
19 use std::path::PathBuf;
21 pub struct Foo(PathBuf);
24 type Target = PathBuf;
25 fn deref(&self) -> &PathBuf { &self.0 }