From 6351bfd182267133409c5174decdff2071f90454 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 16 Feb 2020 02:53:58 +0900 Subject: [PATCH] Add test for issue-39618 --- src/test/ui/specialization/issue-39618.rs | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/ui/specialization/issue-39618.rs diff --git a/src/test/ui/specialization/issue-39618.rs b/src/test/ui/specialization/issue-39618.rs new file mode 100644 index 00000000000..78894a56997 --- /dev/null +++ b/src/test/ui/specialization/issue-39618.rs @@ -0,0 +1,24 @@ +// Regression test for #39618, shouldn't crash. +// check-pass + +#![feature(specialization)] + +trait Foo { + fn foo(&self); +} + +trait Bar { + fn bar(&self); +} + +impl Bar for T where T: Foo { + fn bar(&self) {} +} + +impl Foo for T where T: Bar { + fn foo(&self) {} +} + +impl Foo for u64 {} + +fn main() {}