Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
Add 10 ICEs
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
  • Loading branch information
JohnTitor committed Dec 21, 2022
1 parent b4fbd67 commit aa698ea
Show file tree
Hide file tree
Showing 12 changed files with 190 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ices/102252.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#![feature(min_specialization, rustc_attrs)]

#[rustc_specialization_trait]
pub trait Trait {}

struct Struct
where
Self: Iterator<Item = <Self as Iterator>::Item>, {}

impl Trait for Struct {}

fn main() {}
18 changes: 18 additions & 0 deletions ices/102383-1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

rustc "--edition=2018" "-Zdrop-tracking" "--crate-type=lib" - << EOF
pub struct File<B> {
block: B,
}
pub async fn commit<B: Clone>(this: &mut File<B>) {
async {}.await;
async {}.await;
async {}.await;
async {}.await;
let file = async { &this }.await;
*async { &mut this.block }.await = file.block.clone();
}
EOF
28 changes: 28 additions & 0 deletions ices/102383-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

rustc "-Zdrop-tracking" "--edition=2018" - << EOF
pub struct File<B> {
block: B,
}
pub async fn commit<B: Clone>(this: &mut File<B>) {
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
13 changes: 13 additions & 0 deletions ices/104172.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#![allow(dead_code)]

const N: usize = {
struct U;
! let y = 42;
3
};

struct S {
x: [(); N]
}

fn main() {}
7 changes: 7 additions & 0 deletions ices/104367.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#[derive(A)]
struct S {
d: [u32; {
#![cfg] {
#![w,)
fn main() {}
7 changes: 7 additions & 0 deletions ices/104368.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
struct S {
d: [u32; {
#![cfg_attr(not(X),Y) Z]
}
}

fn main() {}
15 changes: 15 additions & 0 deletions ices/104685.rs
Original file line number Diff line number Diff line change
@@ -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() {}
27 changes: 27 additions & 0 deletions ices/104843.sh
Original file line number Diff line number Diff line change
@@ -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<F> {
None
}
fn main() {
if false
&& let Some(ce) = cex()
&& let Some(_ce) = ce.s()
{
}
}
EOF
21 changes: 21 additions & 0 deletions ices/105821.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#![allow(incomplete_features)]
#![feature(adt_const_params, const_ptr_read, generic_const_exprs)]
#![allow(dead_code)]

const fn catone<const M: usize>(_a: &[u8; M]) -> [u8; M + 1]
where
[(); M + 1]:,
{
unimplemented!()
}

struct Catter<const A: &'static [u8]>;
impl<const A: &'static [u8]> Catter<A>
where
[(); A.len() + 1]:,
{
const ZEROS: &'static [u8; A.len()] = &[0_u8; A.len()];
const R: &'static [u8] = &catone(Self::ZEROS);
}

fn main() {}
16 changes: 16 additions & 0 deletions ices/105952-1.sh
Original file line number Diff line number Diff line change
@@ -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<T: Parse<PARSE_MODE = { ParseMode::Raw }>> RenderRaw for T {}
EOF

rustdoc foo.rs
15 changes: 15 additions & 0 deletions ices/105952-2.sh
Original file line number Diff line number Diff line change
@@ -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<PARSE_MODE = { ParseMode::Raw }> {}
EOF

rustdoc foo.rs
11 changes: 11 additions & 0 deletions ices/105969.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit aa698ea

Please sign in to comment.