]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/issue-19055.rs
Suggest defining type parameter when appropriate
[rust.git] / src / test / rustdoc / issue-19055.rs
1 // @has issue_19055/trait.Any.html
2 pub trait Any {}
3
4 impl<'any> Any + 'any {
5     // @has - '//*[@id="method.is"]' 'fn is'
6     pub fn is<T: 'static>(&self) -> bool { loop {} }
7
8     // @has - '//*[@id="method.downcast_ref"]' 'fn downcast_ref'
9     pub fn downcast_ref<T: 'static>(&self) -> Option<&T> { loop {} }
10
11     // @has - '//*[@id="method.downcast_mut"]' 'fn downcast_mut'
12     pub fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T> { loop {} }
13 }
14
15 pub trait Foo {
16     fn foo(&self) {}
17 }
18
19 // @has - '//*[@id="method.foo"]' 'fn foo'
20 impl Foo for Any {}