From 6c93c65057377d839d1f9d8ea172d898b6b6ce2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:22:06 +0800 Subject: [PATCH] Delete `tests/crashes/23707.rs` because it's flaky It's conditioned on `only-x86_64` because it doesn't reliably fail on other platforms, it's optimization dependent and failed to ICE post-PGO in . Remove this test for now without prejudice against relanding the test in a more reliable form. --- tests/crashes/23707.rs | 109 ----------------------------------------- 1 file changed, 109 deletions(-) delete mode 100644 tests/crashes/23707.rs diff --git a/tests/crashes/23707.rs b/tests/crashes/23707.rs deleted file mode 100644 index 4105933c60f..00000000000 --- a/tests/crashes/23707.rs +++ /dev/null @@ -1,109 +0,0 @@ -//@ known-bug: #23707 -//@ compile-flags: -Copt-level=0 --edition=2021 -//@ only-x86_64 -#![recursion_limit="2048"] - -use std::marker::PhantomData; -use std::fmt; -use std::fmt::Debug; - -pub struct Z( () ); -pub struct S (PhantomData); - - -pub trait Nat { - fn sing() -> Self; - fn get(&self) -> usize; -} - -impl Nat for Z { - fn sing() -> Z { Z( () ) } - #[inline(always)] - fn get(&self) -> usize { - 0 - } -} - -impl Nat for S { - fn sing() -> S { S::( PhantomData:: ) } - #[inline(always)] - fn get(&self) -> usize { - let prd : T = Nat::sing(); - 1 + prd.get() - } -} - -pub type N0 = Z; -pub type N1 = S; -pub type N2 = S; -pub type N3 = S; -pub type N4 = S; -pub type N5 = S; - - -pub struct Node(usize,PhantomData); - -impl Node { - pub fn push(&self, c : usize) -> Node> { - let Node(i,_) = *self; - Node(10*i+c, PhantomData::>) - } -} - -impl Node> { - pub fn pop(&self) -> (Node,usize) { - let Node(i,_) = *self; - (Node(i/10, PhantomData::), i-10*(i/10)) - } -} - -impl Debug for Node { - fn fmt(&self, f : &mut fmt::Formatter) -> fmt::Result { - let s : D = Nat::sing(); - write!(f, "Node<{}>: i= {}", - s.get(), self.0) - } -} -pub trait Step { - fn step(&self, usize) -> Self; -} - -impl Step for Node { - #[inline(always)] - fn step(&self, n : usize) -> Node { - println!("base case"); - Node(n,PhantomData::) - } -} - -impl Step for Node> - where Node : Step { - #[inline(always)] - fn step(&self, n : usize) -> Node> { - println!("rec"); - let (par,c) = self.pop(); - let cnew = c+n; - par.step(c).push(cnew) - } - -} - -fn tst(ref p : &Node, c : usize) -> usize - where Node : Step { - let Node(i,_) = p.step(c); - i -} - - - -fn main() { - let nd : Node = Node(555,PhantomData::); - - // overflow...core::marker::Size - let Node(g,_) = tst(nd,1); - - // ok - //let Node(g,_) = nd.step(1); - - println!("{:?}", g); -}