Skip to content

Commit

Permalink
Auto merge of rust-lang#134608 - DianQK:disable-93775, r=<try>
Browse files Browse the repository at this point in the history
Move test rust-lang#93775 to crashes

Closes rust-lang#132111. Closes rust-lang#133432. Re-opens rust-lang#93775.

I think this test case is flaky because the recursive calls happen to hit the upper limit of the call stack.

IMO, this may not be an issue, as it's reasonable for overly complex code to require additional build configurations (such as increasing the call stack size).

r? jieyouxu

try-job: x86_64-msvc
try-job: i686-msvc
  • Loading branch information
bors committed Dec 21, 2024
2 parents 6076bee + 091613d commit f4e6d38
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 34 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 37 additions & 0 deletions tests/crashes/recursive-print-issue-93775.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//! This test case is modified from <https://github.com/rust-lang/rust/issues/93775>.
//! 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<T>(PhantomData<T>);

type Nested4<T> = S<S<S<S<T>>>>;
type Nested16<T> = Nested4<Nested4<Nested4<Nested4<T>>>>;
type Nested64<T> = Nested16<Nested16<Nested16<Nested16<T>>>>;
type Nested256<T> = Nested64<Nested64<Nested64<Nested64<T>>>>;
type Nested1024<T> = Nested256<Nested256<Nested256<Nested256<T>>>>;
type Nested2048<T> = Nested1024<Nested1024<T>>;

type Nested = Nested2048<Z>;

trait AsNum {
const NUM: u32;
}

impl AsNum for Z {
const NUM: u32 = 0;
}

impl<T: AsNum> AsNum for S<T> {
const NUM: u32 = T::NUM + 1;
}

fn main() {
let _ = Nested::NUM;
}
33 changes: 0 additions & 33 deletions tests/ui/associated-consts/issue-93775.rs

This file was deleted.

0 comments on commit f4e6d38

Please sign in to comment.