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

Commit fdaae30

Browse files
authored
Merge pull request #521 from oliviacrain/changes
Add 5 ICEs
2 parents d60e2dd + 1363203 commit fdaae30

File tree

5 files changed

+79
-0
lines changed

5 files changed

+79
-0
lines changed

ices/78441.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
rustc -Z save-analysis - << EOF
4+
fn main() {
5+
[(); { for _ in 0usize.. {}; 0}];
6+
}
7+
8+
EOF

ices/78442.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
rustc -Z mir-opt-level=2 - << EOF
4+
#![crate_type = "lib"]
5+
6+
// Error won't happen if "bar" is not generic
7+
pub fn bar<P>(_baz: P) {
8+
hide_foo()();
9+
}
10+
11+
// Error won't happen if "iterate" hasn't impl Trait or has generics
12+
fn hide_foo() -> impl Fn() {
13+
foo
14+
}
15+
16+
// Error won't happen if "foo" isn't used in "iterate" or has generics
17+
fn foo() {}
18+
19+
EOF

ices/78450.rs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#![feature(type_alias_impl_trait)]
2+
#![no_std]
3+
#![crate_type = "lib"]
4+
5+
pub trait AssociatedImpl {
6+
type ImplTrait;
7+
8+
fn f() -> Self::ImplTrait;
9+
}
10+
11+
trait DynTrait<'a> {}
12+
13+
struct S<T>(T);
14+
15+
trait Associated {
16+
type A;
17+
}
18+
19+
impl<'a, T: Associated<A = dyn DynTrait<'a>>> AssociatedImpl for S<T> {
20+
type ImplTrait = impl core::future::Future<Output = ()>;
21+
22+
fn f() -> Self::ImplTrait {
23+
async { () }
24+
}
25+
}

ices/78456.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#![feature(type_alias_impl_trait)]
2+
#![no_std]
3+
4+
pub trait Tr<'x> {
5+
type Fut: core::future::Future<Output = ()>;
6+
7+
fn f() -> Self::Fut;
8+
}
9+
10+
impl<'x> Tr<'x> for () {
11+
type Fut = impl core::future::Future<Output = ()>;
12+
13+
fn f() -> Self::Fut {
14+
async {
15+
//if false {
16+
return ();
17+
//}
18+
let res: Undef = ();
19+
res
20+
}
21+
}
22+
}

ices/78459.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![feature(allocator_api)]
2+
3+
fn main() {
4+
Box::new_in(&[0, 1], &std::alloc::Global);
5+
}

0 commit comments

Comments
 (0)