2021-11-26 17:03:16 -06:00
|
|
|
#![deny(rustdoc::broken_intra_doc_links)]
|
2020-11-28 19:25:41 -06:00
|
|
|
#![feature(associated_type_defaults)]
|
|
|
|
|
|
|
|
pub trait TraitWithDefault {
|
|
|
|
type T = usize;
|
|
|
|
fn f() -> Self::T {
|
|
|
|
0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Link to [UsesDefaults::T] and [UsesDefaults::f]
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has 'associated_defaults/struct.UsesDefaults.html' '//a[@href="struct.UsesDefaults.html#associatedtype.T"]' 'UsesDefaults::T'
|
|
|
|
//@ has 'associated_defaults/struct.UsesDefaults.html' '//a[@href="struct.UsesDefaults.html#method.f"]' 'UsesDefaults::f'
|
2020-11-28 19:25:41 -06:00
|
|
|
pub struct UsesDefaults;
|
|
|
|
impl TraitWithDefault for UsesDefaults {}
|
|
|
|
|
|
|
|
/// Link to [OverridesDefaults::T] and [OverridesDefaults::f]
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has 'associated_defaults/struct.OverridesDefaults.html' '//a[@href="struct.OverridesDefaults.html#associatedtype.T"]' 'OverridesDefaults::T'
|
|
|
|
//@ has 'associated_defaults/struct.OverridesDefaults.html' '//a[@href="struct.OverridesDefaults.html#method.f"]' 'OverridesDefaults::f'
|
2020-11-28 19:25:41 -06:00
|
|
|
pub struct OverridesDefaults;
|
|
|
|
impl TraitWithDefault for OverridesDefaults {
|
|
|
|
type T = bool;
|
|
|
|
fn f() -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
}
|