Skip to content

Commit b3e1170

Browse files
committed
Auto merge of rust-lang#124236 - matthiaskrgr:n-ice, r=jieyouxu
crashes: add a couple more ICE tests
2 parents 3288583 + 6774801 commit b3e1170

File tree

6 files changed

+62
-0
lines changed

6 files changed

+62
-0
lines changed

tests/crashes/123664.rs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//@ known-bug: #123664
2+
#![feature(generic_const_exprs, effects)]
3+
const fn with_positive<F: ~const Fn()>() {}
4+
pub fn main() {}

tests/crashes/123955.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: #123955
2+
//@ compile-flags: -Clto -Zvirtual-function-elimination
3+
//@ only-x86_64
4+
pub fn main() {
5+
_ = Box::new(()) as Box<dyn Send>;
6+
}

tests/crashes/124092.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: #124092
2+
//@ compile-flags: -Zvirtual-function-elimination=true -Clto=true
3+
//@ only-x86_64
4+
const X: for<'b> fn(&'b ()) = |&()| ();
5+
fn main() {
6+
let dyn_debug = Box::new(X) as Box<fn(&'static ())> as Box<dyn Send>;
7+
}

tests/crashes/124182.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ known-bug: #124182
2+
struct LazyLock<T> {
3+
data: (Copy, fn() -> T),
4+
}
5+
6+
impl<T> LazyLock<T> {
7+
pub const fn new(f: fn() -> T) -> LazyLock<T> {
8+
LazyLock { data: (None, f) }
9+
}
10+
}
11+
12+
struct A<T = i32>(Option<T>);
13+
14+
impl<T> Default for A<T> {
15+
fn default() -> Self {
16+
A(None)
17+
}
18+
}
19+
20+
static EMPTY_SET: LazyLock<A<i32>> = LazyLock::new(A::default);
21+
22+
fn main() {}

tests/crashes/124189.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #124189
2+
trait Trait {
3+
type Type;
4+
}
5+
6+
impl<T> Trait for T {
7+
type Type = ();
8+
}
9+
10+
fn f(_: <&Copy as Trait>::Type) {}
11+
12+
fn main() {
13+
f(());
14+
}

tests/crashes/124207.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: #124207
2+
#![feature(transmutability)]
3+
#![feature(type_alias_impl_trait)]
4+
trait OpaqueTrait {}
5+
type OpaqueType = impl OpaqueTrait;
6+
trait AnotherTrait {}
7+
impl<T: std::mem::BikeshedIntrinsicFrom<(), ()>> AnotherTrait for T {}
8+
impl AnotherTrait for OpaqueType {}
9+
pub fn main() {}

0 commit comments

Comments
 (0)