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

Add more ICEs #1621

Merged
merged 1 commit into from
Jul 11, 2023
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
24 changes: 24 additions & 0 deletions ices/111709.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use core::arch::asm;

struct TrapFrame;

unsafe extern "C" fn _rust_abi_shim1<A, R>(arg: A, f: fn(A) -> R) -> R {
f(arg)
}

unsafe extern "C" fn _start_trap() {
extern "Rust" {
fn interrupt(tf: &mut TrapFrame);
}
asm!(
"
la a1, {irq}
call {shim}
",
shim = sym crate::_rust_abi_shim1::<&mut TrapFrame, ()>,
irq = sym interrupt,
options(noreturn)
)
}

fn main() {}
6 changes: 6 additions & 0 deletions ices/111906-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fn foo<'a: 'a>() -> impl Sized {
let _: () = foo::<'a>();
loop {}
}

fn main() {}
6 changes: 6 additions & 0 deletions ices/111906-3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fn foo<'a: 'a>() -> impl Sized + 'a {
let _: *mut &'a () = foo::<'a>();
loop {}
}

fn main() {}
5 changes: 5 additions & 0 deletions ices/111911.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#![feature(adt_const_params)]

fn foo<const N: &'static u8>() -> impl Sized {}

fn main() {}
17 changes: 17 additions & 0 deletions ices/112201.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pub fn compose(
f1: impl FnOnce(f64) -> f64 + Clone,
f2: impl FnOnce(f64) -> f64 + Clone,
) -> impl FnOnce(f64) -> f64 + Clone {
move |x| f1(f2(x))
}

fn repeat_helper(
f: impl FnOnce(f64) -> f64 + Clone,
res: impl FnOnce(f64) -> f64 + Clone,
times: usize,
) -> impl FnOnce(f64) -> f64 + Clone {
return res;
repeat_helper(f.clone(), compose(f, res), times - 1)
}

fn main() {}
17 changes: 17 additions & 0 deletions ices/113279.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#![feature(generators)]

fn foo() {
let _y = static || {
let x = &mut 0;
*{
yield;
x
} += match { *"" }.len() {
_ => 0,
};
};
}

fn main() {
foo()
}
13 changes: 13 additions & 0 deletions ices/113375.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#![feature(effects)]

struct Bar<T>(T);

impl<T> Bar<T> {
const fn value() -> usize {
42
}
}

struct Foo<const N: [u8; Bar::<u32>::value()]>;

fn main() {}
12 changes: 12 additions & 0 deletions ices/113378.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#![feature(const_trait_impl)]
#![feature(effects)]

trait Value {}

impl<T> const Value for T {
const fn value() -> u32 {
0
}
}

fn main() {}
14 changes: 14 additions & 0 deletions ices/113381.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#![feature(const_closures, const_trait_imp, effects)]
#![allow(incomplete_features)]

trait Foo {
fn foo(&self);
}

impl Foo for () {
fn foo(&self) {}
}

fn main() {
(const || { (()).foo() })();
}