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

Commit 2b1d085

Browse files
Add some ICEs
1 parent 38883be commit 2b1d085

File tree

13 files changed

+253
-0
lines changed

13 files changed

+253
-0
lines changed

ices/102465.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![feature(lang_items, no_core)]
2+
#![no_std]
3+
#![no_core]
4+
5+
#[lang = "sized"]
6+
pub trait Sized {}
7+
8+
#[lang = "copy"]
9+
trait Copy {}
10+
11+
fn bla(argc: isize) {
12+
match argc {
13+
1 => 1, // removing this arm fixes the ICE
14+
_ => 1,
15+
};
16+
}
17+
18+
fn main() {}

ices/105047.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(raw_ref_op)]
2+
3+
const RCZ: *const i32 = &raw const *&0;
4+
5+
const fn f() {
6+
if let RCZ = &raw const *&0 {}
7+
}
8+
9+
fn main() {}

ices/105819.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#![feature(type_alias_impl_trait)]
2+
// check-pass
3+
4+
fn main() {}
5+
6+
fn upvar() {
7+
#[derive(Copy, Clone)]
8+
struct Foo((u32, u32));
9+
10+
type T = impl Copy;
11+
let foo: T = Foo((1u32, 2u32));
12+
let x = move || {
13+
let Foo((a, b)) = foo;
14+
};
15+
}

ices/105937.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
pub fn encode_num<Writer: ExampleWriter>(n: u32, mut writer: Writer) -> Result<(), Writer::Error> {
2+
if n > 15 {
3+
encode_num(n / 16, &mut writer)?;
4+
}
5+
Ok(())
6+
}
7+
8+
pub trait ExampleWriter {
9+
type Error;
10+
}
11+
12+
impl<'a, T: ExampleWriter> ExampleWriter for &'a mut T {
13+
type Error = T::Error;
14+
}
15+
16+
struct Error;
17+
18+
impl ExampleWriter for Error {
19+
type Error = ();
20+
}
21+
22+
fn main() {
23+
encode_num(69, &mut Error).unwrap();
24+
}

ices/108580.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#![feature(associated_type_bounds, return_position_impl_trait_in_trait)]
2+
#![allow(incomplete_features)]
3+
4+
trait Iterator {
5+
type Item;
6+
}
7+
8+
trait IntoIterator {
9+
fn into_iterator(&self) -> impl Iterator<Item: > + '_;
10+
}
11+
12+
struct IntoIterFn<F, I> {
13+
f: F,
14+
_marker: core::marker::PhantomData<I>,
15+
}
16+
17+
impl<F, I> IntoIterator for IntoIterFn<F, I>
18+
where
19+
F: Fn() -> I,
20+
I: Iterator,
21+
{
22+
fn into_iterator(&self) -> impl Iterator<Item: '_> {
23+
(self.f)()
24+
}
25+
}
26+
27+
fn main() {}

ices/109239.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![allow(incomplete_features)]
2+
#![feature(return_position_impl_trait_in_trait)]
3+
#![crate_type = "lib"]
4+
5+
trait Trait {
6+
type Type;
7+
8+
fn method(&self) -> impl Trait<Type = impl Trait<Type = impl Sized + '_> + '_>;
9+
}
10+
11+
fn main() {}

ices/109281.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(type_alias_impl_trait)]
2+
struct S;
3+
type ReturnType<'a> = impl Eq + 'a;
4+
impl std::ops::Deref for S {
5+
type Target = dyn Fn(&()) -> ReturnType;
6+
fn deref() -> &'static Self::Target {}
7+
}
8+
9+
fn main() {}

ices/109298.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fn arr_by_ref(mut x: [(); 3]) {
2+
let f = || {
3+
let [ref y, ref mut z @ ..] = x;
4+
};
5+
f();
6+
}
7+
8+
fn main() {}

ices/109299.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
trait Document {
2+
fn cursor(&self) -> Lexer::Cursor<'_>;
3+
}
4+
5+
struct Lexer<'d> {
6+
cursor: (),
7+
_phantom: std::marker::PhantomData<&'d ()>,
8+
}
9+
10+
impl<'cursor> Lexer<'d> {
11+
type Cursor<'a> = DocCursorImpl<'a>;
12+
}
13+
14+
fn main() {}

ices/109300.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![feature(generic_const_exprs)]
2+
trait B {
3+
type U<T: A>;
4+
}
5+
6+
fn f<T: B<U<1i32> = ()>>() {}
7+
8+
fn main() {}

0 commit comments

Comments
 (0)