From 37dbe40a7e54a873d047ae530b3a70e52ec8c030 Mon Sep 17 00:00:00 2001 From: Shoyu Vanilla Date: Sat, 23 Mar 2024 23:51:27 +0900 Subject: [PATCH] Add a regression test for #117310 --- .../tait-param-inference-issue-117310.rs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/ui/type-alias-impl-trait/tait-param-inference-issue-117310.rs diff --git a/tests/ui/type-alias-impl-trait/tait-param-inference-issue-117310.rs b/tests/ui/type-alias-impl-trait/tait-param-inference-issue-117310.rs new file mode 100644 index 00000000000..be743e8e270 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/tait-param-inference-issue-117310.rs @@ -0,0 +1,28 @@ +//@ check-pass + +#![feature(type_alias_impl_trait)] +#![allow(dead_code)] + +use std::ops::Deref; + +trait Trait {} +impl Trait for (A, B, u8) where A: Deref, B: Deref, {} +impl Trait for (A, B, i8) {} + +type TaitSized = impl Sized; +fn def_tait1() -> TaitSized {} + +type TaitCopy = impl Copy; +fn def_tait2() -> TaitCopy {} + +fn impl_trait () {} + +fn test() { + impl_trait::<(&TaitSized, &TaitCopy, _)>(); + impl_trait::<(&TaitCopy, &TaitSized, _)>(); + + impl_trait::<(&TaitCopy, &String, _)>(); + impl_trait::<(&TaitSized, &String, _)>(); +} + +fn main() {}