diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-55380.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-55380.rs b/src/test/ui/issues/issue-55380.rs new file mode 100644 index 000000000..f7cb296d3 --- /dev/null +++ b/src/test/ui/issues/issue-55380.rs @@ -0,0 +1,28 @@ +// run-pass +#![feature(specialization)] +//~^ WARN the feature `specialization` is incomplete + +pub trait Foo { + fn abc() -> u32; + fn def() -> u32; +} + +pub trait Marker {} + +impl Marker for () {} + +impl<T> Foo for T { + default fn abc() -> u32 { 16 } + default fn def() -> u32 { 42 } +} + +impl<T: Marker> Foo for T { + fn def() -> u32 { + Self::abc() + } +} + +fn main() { + assert_eq!(<()>::def(), 16); + assert_eq!(<i32>::def(), 42); +} |