From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../specialization-overlap-projection.rs | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/ui/specialization/specialization-overlap-projection.rs (limited to 'tests/ui/specialization/specialization-overlap-projection.rs') diff --git a/tests/ui/specialization/specialization-overlap-projection.rs b/tests/ui/specialization/specialization-overlap-projection.rs new file mode 100644 index 000000000..b07efb2a5 --- /dev/null +++ b/tests/ui/specialization/specialization-overlap-projection.rs @@ -0,0 +1,25 @@ +// run-pass + +// Test that impls on projected self types can resolve overlap, even when the +// projections involve specialization, so long as the associated type is +// provided by the most specialized impl. + +#![feature(specialization)] //~ WARN the feature `specialization` is incomplete + +trait Assoc { + type Output; +} + +impl Assoc for T { + default type Output = bool; +} + +impl Assoc for u8 { type Output = u8; } +impl Assoc for u16 { type Output = u16; } + +trait Foo {} +impl Foo for u32 {} +impl Foo for ::Output {} +impl Foo for ::Output {} + +fn main() {} -- cgit v1.2.3