From 101a81b807a20c2fb30508fd5a1103e1661e45ea Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 19 Oct 2021 02:43:54 +0900 Subject: [PATCH] Add a regression test for #89935 --- src/test/ui/typeck/issue-89935.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/ui/typeck/issue-89935.rs diff --git a/src/test/ui/typeck/issue-89935.rs b/src/test/ui/typeck/issue-89935.rs new file mode 100644 index 0000000000000..03f8f09a72201 --- /dev/null +++ b/src/test/ui/typeck/issue-89935.rs @@ -0,0 +1,18 @@ +// check-pass + +trait Foo: Baz {} +trait Bar {} +trait Baz: Bar { + fn bar(&self); +} + +impl Bar for T {} +impl Baz for T { + fn bar(&self) {} +} + +fn accept_foo(x: Box) { + x.bar(); +} + +fn main() {}