forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#134608 - DianQK:disable-93775, r=jieyouxu
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
Showing
3 changed files
with
37 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file was deleted.
Oops, something went wrong.