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

Commit c1dd1f2

Browse files
authored
Merge pull request #1621 from JohnTitor/ices-20230711
2 parents ea3f055 + 3beddca commit c1dd1f2

File tree

9 files changed

+114
-0
lines changed

9 files changed

+114
-0
lines changed

ices/111709.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use core::arch::asm;
2+
3+
struct TrapFrame;
4+
5+
unsafe extern "C" fn _rust_abi_shim1<A, R>(arg: A, f: fn(A) -> R) -> R {
6+
f(arg)
7+
}
8+
9+
unsafe extern "C" fn _start_trap() {
10+
extern "Rust" {
11+
fn interrupt(tf: &mut TrapFrame);
12+
}
13+
asm!(
14+
"
15+
la a1, {irq}
16+
call {shim}
17+
",
18+
shim = sym crate::_rust_abi_shim1::<&mut TrapFrame, ()>,
19+
irq = sym interrupt,
20+
options(noreturn)
21+
)
22+
}
23+
24+
fn main() {}

ices/111906-1.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn foo<'a: 'a>() -> impl Sized {
2+
let _: () = foo::<'a>();
3+
loop {}
4+
}
5+
6+
fn main() {}

ices/111906-3.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn foo<'a: 'a>() -> impl Sized + 'a {
2+
let _: *mut &'a () = foo::<'a>();
3+
loop {}
4+
}
5+
6+
fn main() {}

ices/111911.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![feature(adt_const_params)]
2+
3+
fn foo<const N: &'static u8>() -> impl Sized {}
4+
5+
fn main() {}

ices/112201.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
pub fn compose(
2+
f1: impl FnOnce(f64) -> f64 + Clone,
3+
f2: impl FnOnce(f64) -> f64 + Clone,
4+
) -> impl FnOnce(f64) -> f64 + Clone {
5+
move |x| f1(f2(x))
6+
}
7+
8+
fn repeat_helper(
9+
f: impl FnOnce(f64) -> f64 + Clone,
10+
res: impl FnOnce(f64) -> f64 + Clone,
11+
times: usize,
12+
) -> impl FnOnce(f64) -> f64 + Clone {
13+
return res;
14+
repeat_helper(f.clone(), compose(f, res), times - 1)
15+
}
16+
17+
fn main() {}

ices/113279.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#![feature(generators)]
2+
3+
fn foo() {
4+
let _y = static || {
5+
let x = &mut 0;
6+
*{
7+
yield;
8+
x
9+
} += match { *"" }.len() {
10+
_ => 0,
11+
};
12+
};
13+
}
14+
15+
fn main() {
16+
foo()
17+
}

ices/113375.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(effects)]
2+
3+
struct Bar<T>(T);
4+
5+
impl<T> Bar<T> {
6+
const fn value() -> usize {
7+
42
8+
}
9+
}
10+
11+
struct Foo<const N: [u8; Bar::<u32>::value()]>;
12+
13+
fn main() {}

ices/113378.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(const_trait_impl)]
2+
#![feature(effects)]
3+
4+
trait Value {}
5+
6+
impl<T> const Value for T {
7+
const fn value() -> u32 {
8+
0
9+
}
10+
}
11+
12+
fn main() {}

ices/113381.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![feature(const_closures, const_trait_imp, effects)]
2+
#![allow(incomplete_features)]
3+
4+
trait Foo {
5+
fn foo(&self);
6+
}
7+
8+
impl Foo for () {
9+
fn foo(&self) {}
10+
}
11+
12+
fn main() {
13+
(const || { (()).foo() })();
14+
}

0 commit comments

Comments
 (0)