From 0a07606c97c644079136ae09587575649999e871 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 20 Dec 2022 19:54:36 +0900 Subject: [PATCH 1/3] Tweak styles Signed-off-by: Yuki Okushi --- fixed/99647.sh | 1 - ices/100612.sh | 1 - ices/101518-1.sh | 3 +-- ices/101518-2.sh | 2 +- ices/101852.rs | 3 +-- ices/101962.rs | 2 +- ices/101964.rs | 1 - ices/98171.sh | 3 +-- ices/98250.sh | 3 +-- ices/99363.sh | 1 - 10 files changed, 6 insertions(+), 14 deletions(-) diff --git a/fixed/99647.sh b/fixed/99647.sh index 0e030948..9d0d523d 100755 --- a/fixed/99647.sh +++ b/fixed/99647.sh @@ -13,4 +13,3 @@ async fn bar() {} fn main() {} EOF - diff --git a/ices/100612.sh b/ices/100612.sh index 455bed53..6143d9c4 100755 --- a/ices/100612.sh +++ b/ices/100612.sh @@ -22,4 +22,3 @@ fn main() { } EOF - diff --git a/ices/101518-1.sh b/ices/101518-1.sh index f0e1474a..16669a18 100644 --- a/ices/101518-1.sh +++ b/ices/101518-1.sh @@ -1,7 +1,6 @@ #!/bin/bash -rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF' - +rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF' #[derive(PartialEq, Eq)] struct Id<'a> { diff --git a/ices/101518-2.sh b/ices/101518-2.sh index 1c2e5893..a8b7ae58 100644 --- a/ices/101518-2.sh +++ b/ices/101518-2.sh @@ -1,6 +1,6 @@ #!/bin/bash -rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF' +rustc -Cincremental=/tmp/a -Zincremental-verify-ich=yes --crate-type lib - <<'EOF' #[derive(Eq, PartialEq)] struct Id(&'static str); diff --git a/ices/101852.rs b/ices/101852.rs index 7bbb4a70..3c55fae7 100644 --- a/ices/101852.rs +++ b/ices/101852.rs @@ -6,5 +6,4 @@ pub fn ice( Vec::new() } -fn main() { -} +fn main() {} diff --git a/ices/101962.rs b/ices/101962.rs index b4e3b825..f2203212 100644 --- a/ices/101962.rs +++ b/ices/101962.rs @@ -4,6 +4,6 @@ pub fn wrapping(a: T, b: T) { let _z = core::intrinsics::wrapping_mul(a, b); } -pub fn main() { +fn main() { wrapping(1,2); } diff --git a/ices/101964.rs b/ices/101964.rs index 7805e716..bd3ab58a 100644 --- a/ices/101964.rs +++ b/ices/101964.rs @@ -1,4 +1,3 @@ - #![crate_type = "lib"] #![feature(lang_items)] #![no_std] diff --git a/ices/98171.sh b/ices/98171.sh index 4a5b0ffc..21b4633e 100755 --- a/ices/98171.sh +++ b/ices/98171.sh @@ -30,7 +30,6 @@ fn main() { //~^ ERROR overflow while adding drop-check rules for FingerTree } - EOF -rustdoc out.rs +rustdoc out.rs diff --git a/ices/98250.sh b/ices/98250.sh index 9baa4c75..bbb85345 100755 --- a/ices/98250.sh +++ b/ices/98250.sh @@ -21,7 +21,6 @@ fn foo() -> Foo { fn main() {} - EOF -rustdoc out.rs +rustdoc out.rs diff --git a/ices/99363.sh b/ices/99363.sh index 230377be..40af36c0 100755 --- a/ices/99363.sh +++ b/ices/99363.sh @@ -16,4 +16,3 @@ fn main() { } EOF - From a185353f21b3b606f8d63d4f0c6a87d89fb53896 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 20 Dec 2022 20:02:07 +0900 Subject: [PATCH 2/3] Add 10 ICEs Signed-off-by: Yuki Okushi --- ices/101198.rs | 31 +++++++++++++++++++++++++++++++ ices/103899.rs | 25 +++++++++++++++++++++++++ ices/104196.rs | 36 ++++++++++++++++++++++++++++++++++++ ices/104779.rs | 18 ++++++++++++++++++ ices/105210.sh | 8 ++++++++ ices/105228.rs | 9 +++++++++ ices/105231.rs | 6 ++++++ ices/105273.sh | 7 +++++++ ices/105305.rs | 12 ++++++++++++ ices/105321.rs | 11 +++++++++++ ices/105334.sh | 11 +++++++++++ ices/98171.sh | 35 ----------------------------------- 12 files changed, 174 insertions(+), 35 deletions(-) create mode 100644 ices/101198.rs create mode 100644 ices/103899.rs create mode 100644 ices/104196.rs create mode 100644 ices/104779.rs create mode 100644 ices/105210.sh create mode 100644 ices/105228.rs create mode 100644 ices/105231.rs create mode 100644 ices/105273.sh create mode 100644 ices/105305.rs create mode 100644 ices/105321.rs create mode 100644 ices/105334.sh delete mode 100755 ices/98171.sh diff --git a/ices/101198.rs b/ices/101198.rs new file mode 100644 index 00000000..b31a89d7 --- /dev/null +++ b/ices/101198.rs @@ -0,0 +1,31 @@ +#![no_std] +#![feature(lang_items, start)] +#![crate_type="lib"] + +#[lang = "owned_box"] +struct Box(*mut T); + +#[lang = "exchange_malloc"] +unsafe fn alloc() -> *mut u8 { + core::ptr::null_mut() +} + +#[lang = "box_free"] +unsafe fn free(ptr: *mut T) { } + +impl Box { + pub fn new(val: T) -> Box { + Box::new(val) + } +} + +#[start] +fn main(i: isize, args: *const *const u8) -> isize { + let x = Box::new(3); + 0 +} + +#[panic_handler] +fn panic_handler(_: &core::panic::PanicInfo) -> ! { + loop {} +} diff --git a/ices/103899.rs b/ices/103899.rs new file mode 100644 index 00000000..cd54c65e --- /dev/null +++ b/ices/103899.rs @@ -0,0 +1,25 @@ +trait BaseWithAssoc { + type Assoc; +} + +trait WrapperWithAssoc { + type BaseAssoc: BaseWithAssoc; +} + +struct Wrapper { + inner: B, +} + +struct ProjectToBase { + data_type_h: T::Assoc, +} + +struct DoubleProject { + buffer: Wrapper>, +} + +fn trigger>() -> DoubleProject { + loop {} +} + +fn main() {} diff --git a/ices/104196.rs b/ices/104196.rs new file mode 100644 index 00000000..f416b2be --- /dev/null +++ b/ices/104196.rs @@ -0,0 +1,36 @@ +use core::future::Future; + +pub struct Struct +where + F: Fn(&C) -> Fu, + Fu: Future, +{ + handler: F, + context: C, +} + +impl Struct +where + F: Fn(&C) -> Fu, + Fu: Future, +{ + pub const fn new(handler: F, context: C) -> Self { + Self { handler, context } + } +} + +type TestC = &'static usize; +type TestFu = impl Future; +type TestF = impl Fn(&TestC) -> TestFu; +type TestStruct = Struct; + +async fn test_handler(context: &TestC) -> () { + () +} + +fn get_test_struct() -> &'static TestStruct { + static test_actor: TestStruct = TestStruct::new(test_handler, &0); + &test_actor +} + +fn main() {} diff --git a/ices/104779.rs b/ices/104779.rs new file mode 100644 index 00000000..cab6d0b5 --- /dev/null +++ b/ices/104779.rs @@ -0,0 +1,18 @@ +struct Inv<'a>(&'a mut &'a ()); +enum Foo { + Bar, + Var(T), +} +type Subtype = Foo fn(Inv<'a>, Inv<'b>)>; +type Supertype = Foo fn(Inv<'a>, Inv<'a>)>; + +fn foo() -> impl Sized { + loop { + match foo() { + Subtype::Bar => (), + Supertype::Var(x) => {} + } + } +} + +fn main() {} diff --git a/ices/105210.sh b/ices/105210.sh new file mode 100644 index 00000000..09c3ed97 --- /dev/null +++ b/ices/105210.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +rustc "--edition-2021" - <<'EOF' + +fn box () { + (( h (const {( default ( await ( await ( (move {await((((}} + +EOF diff --git a/ices/105228.rs b/ices/105228.rs new file mode 100644 index 00000000..402176dc --- /dev/null +++ b/ices/105228.rs @@ -0,0 +1,9 @@ +#![feature(cfg_eval)] +#![feature(stmt_expr_attributes)] + +#[cfg_eval] +fn main() { + #[cfg_eval] + let _ = #[cfg(FALSE)] 0; + //~^ ERROR removing an expression is not supported in this position +} diff --git a/ices/105231.rs b/ices/105231.rs new file mode 100644 index 00000000..e01a3b31 --- /dev/null +++ b/ices/105231.rs @@ -0,0 +1,6 @@ +struct A(B); +struct B(A>); +trait Foo {} +impl Foo for T where T: Send {} +impl Foo for B {} +fn main() {} diff --git a/ices/105273.sh b/ices/105273.sh new file mode 100644 index 00000000..36f740f4 --- /dev/null +++ b/ices/105273.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +rustc "-Zunpretty=ast-tree" - <<'EOF' + +#![c = ({(while ""))(); + +EOF diff --git a/ices/105305.rs b/ices/105305.rs new file mode 100644 index 00000000..0be2839d --- /dev/null +++ b/ices/105305.rs @@ -0,0 +1,12 @@ +#![feature(inherent_associated_types)] +#![allow(incomplete_features)] + +struct S(T); + +impl S { // Also repros with any other lifetimes such as '_ ,switching order to 'a, T also repros. + type P = T; +} + +fn main() { + type A = S<()>::P; +} diff --git a/ices/105321.rs b/ices/105321.rs new file mode 100644 index 00000000..891ec33b --- /dev/null +++ b/ices/105321.rs @@ -0,0 +1,11 @@ +fn hof(_: F) +where + F: FnMut() -> (), +{ +} + +fn f() -> _ { + hof(f); +} + +fn main() {} diff --git a/ices/105334.sh b/ices/105334.sh new file mode 100644 index 00000000..f63ab927 --- /dev/null +++ b/ices/105334.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +cat > out.rs <<'EOF' + +impl Vec< br##"*.."## > {} + +fn main() {} + +EOF + +rustdoc out.rs diff --git a/ices/98171.sh b/ices/98171.sh deleted file mode 100755 index 21b4633e..00000000 --- a/ices/98171.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -cat > out.rs <<'EOF' - -// Issue 22443: Reject code using non-regular types that would -// otherwise cause dropck to loop infinitely. - -use std::marker::PhantomData; - -struct Digit { - elem: T -} - -struct Node { m: PhantomData<&'static T> } - - -enum FingerTree { - Single(T), - // Bug report said Digit after Box would stack overflow (versus - // Digit before Box; see dropck_no_diverge_on_nonregular_2). - Deep( - Box>>, - Digit, - ) -} - -fn main() { - let ft = //~ ERROR overflow while adding drop-check rules for FingerTree - FingerTree::Single(1); - //~^ ERROR overflow while adding drop-check rules for FingerTree -} - -EOF - -rustdoc out.rs From 8914a4d60ff51c19e54f9528b03ea0833b07f14c Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 20 Dec 2022 20:22:34 +0900 Subject: [PATCH 3/3] Remove an ICE that causes infinite compilation Signed-off-by: Yuki Okushi --- ices/105210.sh | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 ices/105210.sh diff --git a/ices/105210.sh b/ices/105210.sh deleted file mode 100644 index 09c3ed97..00000000 --- a/ices/105210.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -rustc "--edition-2021" - <<'EOF' - -fn box () { - (( h (const {( default ( await ( await ( (move {await((((}} - -EOF