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

Add 10 ICEs #1469

Merged
merged 2 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ices/100772.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ fn main() {
}

EOF

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() {}
2 changes: 1 addition & 1 deletion ices/91380.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ pub struct SecondaryResolutionHomomorphism<
}
EOF

rustdoc foo.rs
rustdoc foo.rs
3 changes: 0 additions & 3 deletions ices/96287.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash

cat > out.rs <<'EOF'


#![feature(type_alias_impl_trait)]

fn main() {}
Expand All @@ -21,7 +19,6 @@ fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T> {
()
}


EOF

rustdoc --edition=2021 out.rs