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

Commit 4e01f82

Browse files
committed
Add 9 ICEs
Signed-off-by: Yuki Okushi <[email protected]>
1 parent 0a07606 commit 4e01f82

11 files changed

+168
-35
lines changed

ices/101198.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#![no_std]
2+
#![feature(lang_items, start)]
3+
#![crate_type="lib"]
4+
5+
#[lang = "owned_box"]
6+
struct Box<T>(*mut T);
7+
8+
#[lang = "exchange_malloc"]
9+
unsafe fn alloc() -> *mut u8 {
10+
core::ptr::null_mut()
11+
}
12+
13+
#[lang = "box_free"]
14+
unsafe fn free<T: ?Sized>(ptr: *mut T) { }
15+
16+
impl<T> Box<T> {
17+
pub fn new(val: T) -> Box<T> {
18+
Box::new(val)
19+
}
20+
}
21+
22+
#[start]
23+
fn main(i: isize, args: *const *const u8) -> isize {
24+
let x = Box::new(3);
25+
0
26+
}
27+
28+
#[panic_handler]
29+
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
30+
loop {}
31+
}

ices/103899.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
trait BaseWithAssoc {
2+
type Assoc;
3+
}
4+
5+
trait WrapperWithAssoc {
6+
type BaseAssoc: BaseWithAssoc;
7+
}
8+
9+
struct Wrapper<B> {
10+
inner: B,
11+
}
12+
13+
struct ProjectToBase<T: BaseWithAssoc> {
14+
data_type_h: T::Assoc,
15+
}
16+
17+
struct DoubleProject<L: WrapperWithAssoc> {
18+
buffer: Wrapper<ProjectToBase<L::BaseAssoc>>,
19+
}
20+
21+
fn trigger<L: WrapperWithAssoc<BaseAssoc = ()>>() -> DoubleProject<L> {
22+
loop {}
23+
}
24+
25+
fn main() {}

ices/104196.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
use core::future::Future;
2+
3+
pub struct Struct<C, Fu, F>
4+
where
5+
F: Fn(&C) -> Fu,
6+
Fu: Future,
7+
{
8+
handler: F,
9+
context: C,
10+
}
11+
12+
impl<C, Fu, R, F> Struct<C, Fu, F>
13+
where
14+
F: Fn(&C) -> Fu,
15+
Fu: Future<Output = R>,
16+
{
17+
pub const fn new(handler: F, context: C) -> Self {
18+
Self { handler, context }
19+
}
20+
}
21+
22+
type TestC = &'static usize;
23+
type TestFu = impl Future;
24+
type TestF = impl Fn(&TestC) -> TestFu;
25+
type TestStruct = Struct<TestC, TestFu, TestF>;
26+
27+
async fn test_handler(context: &TestC) -> () {
28+
()
29+
}
30+
31+
fn get_test_struct() -> &'static TestStruct {
32+
static test_actor: TestStruct = TestStruct::new(test_handler, &0);
33+
&test_actor
34+
}
35+
36+
fn main() {}

ices/104779.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
struct Inv<'a>(&'a mut &'a ());
2+
enum Foo<T> {
3+
Bar,
4+
Var(T),
5+
}
6+
type Subtype = Foo<for<'a, 'b> fn(Inv<'a>, Inv<'b>)>;
7+
type Supertype = Foo<for<'a> fn(Inv<'a>, Inv<'a>)>;
8+
9+
fn foo() -> impl Sized {
10+
loop {
11+
match foo() {
12+
Subtype::Bar => (),
13+
Supertype::Var(x) => {}
14+
}
15+
}
16+
}
17+
18+
fn main() {}

ices/105210.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
rustc "--edition-2021" - <<'EOF'
4+
5+
fn box () {
6+
(( h (const {( default ( await ( await ( (move {await((((}}
7+
8+
EOF

ices/105228.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(cfg_eval)]
2+
#![feature(stmt_expr_attributes)]
3+
4+
#[cfg_eval]
5+
fn main() {
6+
#[cfg_eval]
7+
let _ = #[cfg(FALSE)] 0;
8+
//~^ ERROR removing an expression is not supported in this position
9+
}

ices/105273.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
rustc "-Zunpretty=ast-tree" - <<'EOF'
4+
5+
#![c = ({(while ""))();
6+
7+
EOF

ices/105305.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(inherent_associated_types)]
2+
#![allow(incomplete_features)]
3+
4+
struct S<T>(T);
5+
6+
impl<T, 'a> S<T> { // Also repros with any other lifetimes such as '_ ,switching order to 'a, T also repros.
7+
type P = T;
8+
}
9+
10+
fn main() {
11+
type A = S<()>::P;
12+
}

ices/105321.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
fn hof<F>(_: F)
2+
where
3+
F: FnMut() -> (),
4+
{
5+
}
6+
7+
fn f() -> _ {
8+
hof(f);
9+
}
10+
11+
fn main() {}

ices/105334.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
cat > out.rs <<'EOF'
4+
5+
impl Vec< br##"*.."## > {}
6+
7+
fn main() {}
8+
9+
EOF
10+
11+
rustdoc out.rs

ices/98171.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)