From aa698ea1260d66ba60a0e8c24ed9b2b60d07411f Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 21 Dec 2022 22:00:40 +0900 Subject: [PATCH 1/2] Add 10 ICEs Signed-off-by: Yuki Okushi --- ices/102252.rs | 12 ++++++++++++ ices/102383-1.sh | 18 ++++++++++++++++++ ices/102383-2.sh | 28 ++++++++++++++++++++++++++++ ices/104172.rs | 13 +++++++++++++ ices/104367.rs | 7 +++++++ ices/104368.rs | 7 +++++++ ices/104685.rs | 15 +++++++++++++++ ices/104843.sh | 27 +++++++++++++++++++++++++++ ices/105821.rs | 21 +++++++++++++++++++++ ices/105952-1.sh | 16 ++++++++++++++++ ices/105952-2.sh | 15 +++++++++++++++ ices/105969.rs | 11 +++++++++++ 12 files changed, 190 insertions(+) create mode 100644 ices/102252.rs create mode 100644 ices/102383-1.sh create mode 100644 ices/102383-2.sh create mode 100644 ices/104172.rs create mode 100644 ices/104367.rs create mode 100644 ices/104368.rs create mode 100644 ices/104685.rs create mode 100644 ices/104843.sh create mode 100644 ices/105821.rs create mode 100644 ices/105952-1.sh create mode 100644 ices/105952-2.sh create mode 100644 ices/105969.rs diff --git a/ices/102252.rs b/ices/102252.rs new file mode 100644 index 00000000..66f69d54 --- /dev/null +++ b/ices/102252.rs @@ -0,0 +1,12 @@ +#![feature(min_specialization, rustc_attrs)] + +#[rustc_specialization_trait] +pub trait Trait {} + +struct Struct +where + Self: Iterator::Item>, {} + +impl Trait for Struct {} + +fn main() {} diff --git a/ices/102383-1.sh b/ices/102383-1.sh new file mode 100644 index 00000000..b719a5f3 --- /dev/null +++ b/ices/102383-1.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +rustc "--edition=2018" "-Zdrop-tracking" "--crate-type=lib" - << EOF +pub struct File { + block: B, +} + +pub async fn commit(this: &mut File) { + async {}.await; + async {}.await; + async {}.await; + async {}.await; + + let file = async { &this }.await; + *async { &mut this.block }.await = file.block.clone(); +} + +EOF diff --git a/ices/102383-2.sh b/ices/102383-2.sh new file mode 100644 index 00000000..fbd73fbf --- /dev/null +++ b/ices/102383-2.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +rustc "-Zdrop-tracking" "--edition=2018" - << EOF +pub struct File { + block: B, +} + +pub async fn commit(this: &mut File) { + async {}.await; + async {}.await; + async {}.await; + async {}.await; + + let file = async { &this }.await; + *async { &mut this.block }.await = file.block.clone(); +} + +fn main() { + let mut file = File { + block: String::new(), + }; + let _ = async move { + commit(&mut file).await; + }; +} + + +EOF diff --git a/ices/104172.rs b/ices/104172.rs new file mode 100644 index 00000000..96e4d5e0 --- /dev/null +++ b/ices/104172.rs @@ -0,0 +1,13 @@ +#![allow(dead_code)] + +const N: usize = { + struct U; + ! let y = 42; + 3 +}; + +struct S { + x: [(); N] +} + +fn main() {} diff --git a/ices/104367.rs b/ices/104367.rs new file mode 100644 index 00000000..a52f28c1 --- /dev/null +++ b/ices/104367.rs @@ -0,0 +1,7 @@ +#[derive(A)] +struct S { + d: [u32; { + #![cfg] { + #![w,) + +fn main() {} diff --git a/ices/104368.rs b/ices/104368.rs new file mode 100644 index 00000000..d5ae0144 --- /dev/null +++ b/ices/104368.rs @@ -0,0 +1,7 @@ +struct S { + d: [u32; { + #![cfg_attr(not(X),Y) Z] + } +} + +fn main() {} diff --git a/ices/104685.rs b/ices/104685.rs new file mode 100644 index 00000000..c77d88dc --- /dev/null +++ b/ices/104685.rs @@ -0,0 +1,15 @@ +#![feature(extern_types)] + +extern "C" { + pub type ExternType; +} + +extern "C" { + pub static EXTERN: ExternType; +} + +pub static EMPTY: () = unsafe { + &EXTERN; +}; + +fn main() {} diff --git a/ices/104843.sh b/ices/104843.sh new file mode 100644 index 00000000..887ad147 --- /dev/null +++ b/ices/104843.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +rustc -O - << EOF + +#![feature(let_chains)] + +struct F(Box<()>); + +impl F { + fn s(&self) -> Option<&str> { + None + } +} + +fn cex() -> Option { + None +} + +fn main() { + if false + && let Some(ce) = cex() + && let Some(_ce) = ce.s() + { + } +} + +EOF diff --git a/ices/105821.rs b/ices/105821.rs new file mode 100644 index 00000000..83603c71 --- /dev/null +++ b/ices/105821.rs @@ -0,0 +1,21 @@ +#![allow(incomplete_features)] +#![feature(adt_const_params, const_ptr_read, generic_const_exprs)] +#![allow(dead_code)] + +const fn catone(_a: &[u8; M]) -> [u8; M + 1] +where + [(); M + 1]:, +{ + unimplemented!() +} + +struct Catter; +impl Catter +where + [(); A.len() + 1]:, +{ + const ZEROS: &'static [u8; A.len()] = &[0_u8; A.len()]; + const R: &'static [u8] = &catone(Self::ZEROS); +} + +fn main() {} diff --git a/ices/105952-1.sh b/ices/105952-1.sh new file mode 100644 index 00000000..3421fa1d --- /dev/null +++ b/ices/105952-1.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +cat > foo.rs << EOF +#![feature(associated_const_equality)] +pub enum ParseMode { + Raw, +} +pub trait Parse { + const PARSE_MODE: ParseMode; +} +pub trait RenderRaw {} +impl> RenderRaw for T {} + +EOF + +rustdoc foo.rs diff --git a/ices/105952-2.sh b/ices/105952-2.sh new file mode 100644 index 00000000..73c83c13 --- /dev/null +++ b/ices/105952-2.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +cat > foo.rs << EOF +#![feature(associated_const_equality)] +pub enum ParseMode { + Raw, +} +pub trait Parse { + const PARSE_MODE: ParseMode; +} +pub trait RenderRaw: Parse {} + +EOF + +rustdoc foo.rs diff --git a/ices/105969.rs b/ices/105969.rs new file mode 100644 index 00000000..35449093 --- /dev/null +++ b/ices/105969.rs @@ -0,0 +1,11 @@ +#![feature(dyn_star)] +#![allow(incomplete_features)] + +use core::fmt::Debug; + +const FOO: () = { + let foo = &3; + let i = foo as dyn* Debug; +}; + +fn main() {} From 1063a8fc95bb8d429aa1fb27d958b66d5c2ac4f2 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 21 Dec 2022 22:00:45 +0900 Subject: [PATCH 2/2] Tweak styles Signed-off-by: Yuki Okushi --- ices/100772.sh | 1 - ices/91380.sh | 2 +- ices/96287.sh | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ices/100772.sh b/ices/100772.sh index af9c7ae4..89f0cb88 100755 --- a/ices/100772.sh +++ b/ices/100772.sh @@ -9,4 +9,3 @@ fn main() { } EOF - diff --git a/ices/91380.sh b/ices/91380.sh index fb7d7647..fbc2b8e8 100644 --- a/ices/91380.sh +++ b/ices/91380.sh @@ -37,4 +37,4 @@ pub struct SecondaryResolutionHomomorphism< } EOF -rustdoc foo.rs \ No newline at end of file +rustdoc foo.rs diff --git a/ices/96287.sh b/ices/96287.sh index c7c1acce..02e1861b 100755 --- a/ices/96287.sh +++ b/ices/96287.sh @@ -1,8 +1,6 @@ #!/bin/bash cat > out.rs <<'EOF' - - #![feature(type_alias_impl_trait)] fn main() {} @@ -21,7 +19,6 @@ fn foo_desugared(_: T) -> Foo { () } - EOF rustdoc --edition=2021 out.rs