2021-03-13 14:04:12 +00:00
|
|
|
pub trait MyTrait {
|
|
|
|
type Assoc;
|
2021-08-30 14:47:17 +00:00
|
|
|
const VALUE: u32 = 12;
|
2021-03-13 14:04:12 +00:00
|
|
|
fn trait_function(&self);
|
|
|
|
fn defaulted(&self) {}
|
|
|
|
fn defaulted_override(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for String {
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-1"]//a[@class="associatedtype"]/@href' #associatedtype.Assoc
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-1"]//a[@class="anchor"]/@href' #associatedtype.Assoc-1
|
2021-03-13 14:04:12 +00:00
|
|
|
type Assoc = ();
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-1"]//a[@class="constant"]/@href' #associatedconstant.VALUE
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-1"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-1
|
2021-03-13 14:04:12 +00:00
|
|
|
const VALUE: u32 = 5;
|
2022-11-28 17:21:19 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' #tymethod.trait_function
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function
|
2021-03-13 14:04:12 +00:00
|
|
|
fn trait_function(&self) {}
|
2022-11-28 17:21:19 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-1"]//a[@class="fn"]/@href' #method.defaulted_override
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-1"]//a[@class="anchor"]/@href' #method.defaulted_override-1
|
2021-03-13 14:04:12 +00:00
|
|
|
fn defaulted_override(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for Vec<u8> {
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-2"]//a[@class="associatedtype"]/@href' #associatedtype.Assoc
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-2"]//a[@class="anchor"]/@href' #associatedtype.Assoc-2
|
2021-03-13 14:04:12 +00:00
|
|
|
type Assoc = ();
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-2"]//a[@class="constant"]/@href' #associatedconstant.VALUE
|
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-2"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-2
|
2021-03-13 14:04:12 +00:00
|
|
|
const VALUE: u32 = 5;
|
2022-11-28 17:21:19 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' #tymethod.trait_function
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function-1"]//a[@class="anchor"]/@href' #method.trait_function-1
|
2021-03-13 14:04:12 +00:00
|
|
|
fn trait_function(&self) {}
|
2022-11-28 17:21:19 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-2"]//a[@class="fn"]/@href' #method.defaulted_override
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-2"]//a[@class="anchor"]/@href' #method.defaulted_override-2
|
2021-03-13 14:04:12 +00:00
|
|
|
fn defaulted_override(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl MyTrait for MyStruct {
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-3"]//a[@class="anchor"]/@href' #associatedtype.Assoc-3
|
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedtype.Assoc"]//a[@class="associatedtype"]/@href' trait.MyTrait.html#associatedtype.Assoc
|
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedtype.Assoc"]//a[@class="anchor"]/@href' #associatedtype.Assoc
|
2021-03-13 14:04:12 +00:00
|
|
|
type Assoc = bool;
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-3"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-3
|
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedconstant.VALUE"]//a[@class="constant"]/@href' trait.MyTrait.html#associatedconstant.VALUE
|
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedconstant.VALUE"]//a[@class="anchor"]/@href' #associatedconstant.VALUE
|
2021-03-13 14:04:12 +00:00
|
|
|
const VALUE: u32 = 20;
|
2022-11-28 17:21:19 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' trait.MyTrait.html#tymethod.trait_function
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function
|
2021-03-13 14:04:12 +00:00
|
|
|
fn trait_function(&self) {}
|
2022-11-28 17:21:19 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted_override"]//a[@class="fn"]/@href' trait.MyTrait.html#method.defaulted_override
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted_override"]//a[@class="anchor"]/@href' #method.defaulted_override
|
2021-03-13 14:04:12 +00:00
|
|
|
fn defaulted_override(&self) {}
|
2022-11-28 17:21:19 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted"]//a[@class="fn"]/@href' trait.MyTrait.html#method.defaulted
|
2022-02-02 06:11:36 +00:00
|
|
|
// @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted"]//a[@class="anchor"]/@href' #method.defaulted
|
2021-03-13 14:04:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub struct MyStruct;
|
2021-08-30 14:47:17 +00:00
|
|
|
|
|
|
|
// We check that associated items with default values aren't generated in the implementors list.
|
|
|
|
impl MyTrait for (u8, u8) {
|
2022-08-13 04:56:16 +00:00
|
|
|
// @!has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-4"]' ''
|
2021-08-30 14:47:17 +00:00
|
|
|
type Assoc = bool;
|
|
|
|
fn trait_function(&self) {}
|
|
|
|
}
|