From 5028d20589c3f7c5d7bd4704b9d3bc6ec42e1767 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 15 Jun 2022 21:31:47 +0900 Subject: [PATCH] Add regression test for #93775 Signed-off-by: Yuki Okushi --- src/test/ui/associated-consts/issue-93775.rs | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/test/ui/associated-consts/issue-93775.rs diff --git a/src/test/ui/associated-consts/issue-93775.rs b/src/test/ui/associated-consts/issue-93775.rs new file mode 100644 index 0000000000000..7a007b732de8e --- /dev/null +++ b/src/test/ui/associated-consts/issue-93775.rs @@ -0,0 +1,29 @@ +// build-pass +// ignore-tidy-linelength + +// Regression for #93775, needs build-pass to test it. + +#![recursion_limit = "1000"] + +use std::marker::PhantomData; + +struct Z; +struct S(PhantomData); + +type Nested = S>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>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