From 7addc115eb18fb4a1e5347b55a138d0428fb6344 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 23 May 2020 18:59:27 +0100 Subject: Work around type normalization issues --- .../usefulness/issue-72476-associated-type.rs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/ui/pattern/usefulness/issue-72476-associated-type.rs (limited to 'src/test/ui/pattern') diff --git a/src/test/ui/pattern/usefulness/issue-72476-associated-type.rs b/src/test/ui/pattern/usefulness/issue-72476-associated-type.rs new file mode 100644 index 00000000000..21ad6c7d989 --- /dev/null +++ b/src/test/ui/pattern/usefulness/issue-72476-associated-type.rs @@ -0,0 +1,23 @@ +// check-pass + +// From https://github.com/rust-lang/rust/issues/72476 + +trait A { + type Projection; +} + +impl A for () { + type Projection = bool; + // using () instead of bool here does compile though +} + +struct Next(T::Projection); + +fn f(item: Next<()>) { + match item { + Next(true) => {} + Next(false) => {} + } +} + +fn main() {} -- cgit 1.4.1-3-g733a5