From 091613d6baed9eeb8f1feba4c6f00e850e39e049 Mon Sep 17 00:00:00 2001 From: DianQK Date: Sat, 21 Dec 2024 17:32:37 +0800 Subject: [PATCH] Move test #93775 to crashes --- src/tools/tidy/src/issues.txt | 1 - tests/crashes/recursive-print-issue-93775.rs | 37 ++++++++++++++++++++ tests/ui/associated-consts/issue-93775.rs | 33 ----------------- 3 files changed, 37 insertions(+), 34 deletions(-) create mode 100644 tests/crashes/recursive-print-issue-93775.rs delete mode 100644 tests/ui/associated-consts/issue-93775.rs diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 25cd32063aab8..6ed8393206bf7 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -44,7 +44,6 @@ ui/associated-consts/issue-58022.rs ui/associated-consts/issue-63496.rs ui/associated-consts/issue-69020-assoc-const-arith-overflow.rs ui/associated-consts/issue-88599-ref-self.rs -ui/associated-consts/issue-93775.rs ui/associated-consts/issue-93835.rs ui/associated-inherent-types/issue-104260.rs ui/associated-inherent-types/issue-109071.rs diff --git a/tests/crashes/recursive-print-issue-93775.rs b/tests/crashes/recursive-print-issue-93775.rs new file mode 100644 index 0000000000000..1b13a1d242e2b --- /dev/null +++ b/tests/crashes/recursive-print-issue-93775.rs @@ -0,0 +1,37 @@ +//! This test case is modified from . +//! The type printing involves recursive calls that lead to stack overflow. +//! If it no longer crashes, please increase the nested type levels +//! unless you are fixing this issue. +//@ known-bug: #93775 + +#![recursion_limit = "2049"] + +use std::marker::PhantomData; + +struct Z; +struct S(PhantomData); + +type Nested4 = S>>>; +type Nested16 = Nested4>>>; +type Nested64 = Nested16>>>; +type Nested256 = Nested64>>>; +type Nested1024 = Nested256>>>; +type Nested2048 = Nested1024>; + +type Nested = Nested2048; + +trait AsNum { + const NUM: u32; +} + +impl AsNum for Z { + const NUM: u32 = 0; +} + +impl AsNum for S { + const NUM: u32 = T::NUM + 1; +} + +fn main() { + let _ = Nested::NUM; +} diff --git a/tests/ui/associated-consts/issue-93775.rs b/tests/ui/associated-consts/issue-93775.rs deleted file mode 100644 index d7416d03707aa..0000000000000 --- a/tests/ui/associated-consts/issue-93775.rs +++ /dev/null @@ -1,33 +0,0 @@ -//@ ignore-windows-msvc -// FIXME(#132111, #133432): this test is flaky on windows msvc, it sometimes fail but it sometimes -// passes. - -//@ build-pass -// ignore-tidy-linelength - -// Regression for #93775, needs build-pass to test it. - -#![recursion_limit = "1001"] - -use std::marker::PhantomData; - -struct Z; -struct S(PhantomData); - -type Nested = S>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>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