From 3beddca5ef91218f9dc19eddc6dd7a73b48e6c55 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 11 Jul 2023 04:56:24 +0900 Subject: [PATCH] Add more ICEs Signed-off-by: Yuki Okushi --- ices/111709.rs | 24 ++++++++++++++++++++++++ ices/111906-1.rs | 6 ++++++ ices/111906-3.rs | 6 ++++++ ices/111911.rs | 5 +++++ ices/112201.rs | 17 +++++++++++++++++ ices/113279.rs | 17 +++++++++++++++++ ices/113375.rs | 13 +++++++++++++ ices/113378.rs | 12 ++++++++++++ ices/113381.rs | 14 ++++++++++++++ 9 files changed, 114 insertions(+) create mode 100644 ices/111709.rs create mode 100644 ices/111906-1.rs create mode 100644 ices/111906-3.rs create mode 100644 ices/111911.rs create mode 100644 ices/112201.rs create mode 100644 ices/113279.rs create mode 100644 ices/113375.rs create mode 100644 ices/113378.rs create mode 100644 ices/113381.rs diff --git a/ices/111709.rs b/ices/111709.rs new file mode 100644 index 00000000..7d25f048 --- /dev/null +++ b/ices/111709.rs @@ -0,0 +1,24 @@ +use core::arch::asm; + +struct TrapFrame; + +unsafe extern "C" fn _rust_abi_shim1(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() {} diff --git a/ices/111906-1.rs b/ices/111906-1.rs new file mode 100644 index 00000000..80aaa0d0 --- /dev/null +++ b/ices/111906-1.rs @@ -0,0 +1,6 @@ +fn foo<'a: 'a>() -> impl Sized { + let _: () = foo::<'a>(); + loop {} +} + +fn main() {} diff --git a/ices/111906-3.rs b/ices/111906-3.rs new file mode 100644 index 00000000..c8776475 --- /dev/null +++ b/ices/111906-3.rs @@ -0,0 +1,6 @@ +fn foo<'a: 'a>() -> impl Sized + 'a { + let _: *mut &'a () = foo::<'a>(); + loop {} +} + +fn main() {} diff --git a/ices/111911.rs b/ices/111911.rs new file mode 100644 index 00000000..50909f6a --- /dev/null +++ b/ices/111911.rs @@ -0,0 +1,5 @@ +#![feature(adt_const_params)] + +fn foo() -> impl Sized {} + +fn main() {} diff --git a/ices/112201.rs b/ices/112201.rs new file mode 100644 index 00000000..8c4de7a2 --- /dev/null +++ b/ices/112201.rs @@ -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() {} diff --git a/ices/113279.rs b/ices/113279.rs new file mode 100644 index 00000000..b26d4b69 --- /dev/null +++ b/ices/113279.rs @@ -0,0 +1,17 @@ +#![feature(generators)] + +fn foo() { + let _y = static || { + let x = &mut 0; + *{ + yield; + x + } += match { *"" }.len() { + _ => 0, + }; + }; +} + +fn main() { + foo() +} diff --git a/ices/113375.rs b/ices/113375.rs new file mode 100644 index 00000000..eec15421 --- /dev/null +++ b/ices/113375.rs @@ -0,0 +1,13 @@ +#![feature(effects)] + +struct Bar(T); + +impl Bar { + const fn value() -> usize { + 42 + } +} + +struct Foo::value()]>; + +fn main() {} diff --git a/ices/113378.rs b/ices/113378.rs new file mode 100644 index 00000000..0e7fa637 --- /dev/null +++ b/ices/113378.rs @@ -0,0 +1,12 @@ +#![feature(const_trait_impl)] +#![feature(effects)] + +trait Value {} + +impl const Value for T { + const fn value() -> u32 { + 0 + } +} + +fn main() {} diff --git a/ices/113381.rs b/ices/113381.rs new file mode 100644 index 00000000..79cab08d --- /dev/null +++ b/ices/113381.rs @@ -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() })(); +}