From 50423aedce823635060fe30fb903b51aa448d04c Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 20 Jul 2022 06:42:35 +0900 Subject: [PATCH] Add regression test for #71547 Signed-off-by: Yuki Okushi --- .../ui/const-generics/issues/issue-71547.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/ui/const-generics/issues/issue-71547.rs diff --git a/src/test/ui/const-generics/issues/issue-71547.rs b/src/test/ui/const-generics/issues/issue-71547.rs new file mode 100644 index 00000000000..60776a1a985 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-71547.rs @@ -0,0 +1,18 @@ +// check-pass + +#![feature(adt_const_params)] +#![allow(incomplete_features)] + +pub trait GetType { + type Ty; + fn get(&self) -> &Self::Ty; +} + +pub fn get_val(value: &T) -> &T::Ty +where + T: GetType<"hello">, +{ + value.get() +} + +fn main() {}