2021-03-13 15:04:12 +01:00
|
|
|
pub trait MyTrait {
|
|
|
|
type Assoc;
|
|
|
|
const VALUE: u32;
|
|
|
|
fn trait_function(&self);
|
|
|
|
fn defaulted(&self) {}
|
|
|
|
fn defaulted_override(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl MyTrait for String {
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedtype.Assoc-1"]//a[@class="type"]/@href' #associatedtype.Assoc
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedtype.Assoc-1"]//a[@class="anchor"]/@href' #associatedtype.Assoc-1
|
2021-03-13 15:04:12 +01:00
|
|
|
type Assoc = ();
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-1"]//a[@class="constant"]/@href' #associatedconstant.VALUE
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-1"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-1
|
2021-03-13 15:04:12 +01:00
|
|
|
const VALUE: u32 = 5;
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.trait_function"]//a[@class="fnname"]/@href' #tymethod.trait_function
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function
|
2021-03-13 15:04:12 +01:00
|
|
|
fn trait_function(&self) {}
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.defaulted_override-1"]//a[@class="fnname"]/@href' #method.defaulted_override
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.defaulted_override-1"]//a[@class="anchor"]/@href' #method.defaulted_override-1
|
2021-03-13 15:04:12 +01:00
|
|
|
fn defaulted_override(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for Vec<u8> {
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedtype.Assoc-2"]//a[@class="type"]/@href' #associatedtype.Assoc
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedtype.Assoc-2"]//a[@class="anchor"]/@href' #associatedtype.Assoc-2
|
2021-03-13 15:04:12 +01:00
|
|
|
type Assoc = ();
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-2"]//a[@class="constant"]/@href' #associatedconstant.VALUE
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-2"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-2
|
2021-03-13 15:04:12 +01:00
|
|
|
const VALUE: u32 = 5;
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.trait_function"]//a[@class="fnname"]/@href' #tymethod.trait_function
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.trait_function-1"]//a[@class="anchor"]/@href' #method.trait_function-1
|
2021-03-13 15:04:12 +01:00
|
|
|
fn trait_function(&self) {}
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.defaulted_override-2"]//a[@class="fnname"]/@href' #method.defaulted_override
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="method.defaulted_override-2"]//a[@class="anchor"]/@href' #method.defaulted_override-2
|
2021-03-13 15:04:12 +01:00
|
|
|
fn defaulted_override(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for MyStruct {
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="associatedtype.Assoc"]//a[@class="type"]/@href' trait.MyTrait.html#associatedtype.Assoc
|
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="associatedtype.Assoc"]//a[@class="anchor"]/@href' #associatedtype.Assoc
|
2021-03-13 15:04:12 +01:00
|
|
|
type Assoc = bool;
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="associatedconstant.VALUE"]//a[@class="constant"]/@href' trait.MyTrait.html#associatedconstant.VALUE
|
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="associatedconstant.VALUE"]//a[@class="anchor"]/@href' #associatedconstant.VALUE
|
2021-03-13 15:04:12 +01:00
|
|
|
const VALUE: u32 = 20;
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.trait_function"]//a[@class="fnname"]/@href' trait.MyTrait.html#tymethod.trait_function
|
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function
|
2021-03-13 15:04:12 +01:00
|
|
|
fn trait_function(&self) {}
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.defaulted_override"]//a[@class="fnname"]/@href' trait.MyTrait.html#method.defaulted_override
|
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.defaulted_override"]//a[@class="anchor"]/@href' #method.defaulted_override
|
2021-03-13 15:04:12 +01:00
|
|
|
fn defaulted_override(&self) {}
|
2021-04-23 22:15:57 +02:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.defaulted"]//a[@class="fnname"]/@href' trait.MyTrait.html#method.defaulted
|
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//div[@id="method.defaulted"]//a[@class="anchor"]/@href' #method.defaulted
|
2021-03-13 15:04:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pub struct MyStruct;
|