Skip to content

crashes: add a couple more ICE tests #124236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/crashes/123664.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//@ known-bug: #123664
#![feature(generic_const_exprs, effects)]
const fn with_positive<F: ~const Fn()>() {}
pub fn main() {}
6 changes: 6 additions & 0 deletions tests/crashes/123955.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//@ known-bug: #123955
//@ compile-flags: -Clto -Zvirtual-function-elimination
//@ only-x86_64
pub fn main() {
_ = Box::new(()) as Box<dyn Send>;
}
7 changes: 7 additions & 0 deletions tests/crashes/124092.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ known-bug: #124092
//@ compile-flags: -Zvirtual-function-elimination=true -Clto=true
//@ only-x86_64
const X: for<'b> fn(&'b ()) = |&()| ();
fn main() {
let dyn_debug = Box::new(X) as Box<fn(&'static ())> as Box<dyn Send>;
}
22 changes: 22 additions & 0 deletions tests/crashes/124182.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//@ known-bug: #124182
struct LazyLock<T> {
data: (Copy, fn() -> T),
}

impl<T> LazyLock<T> {
pub const fn new(f: fn() -> T) -> LazyLock<T> {
LazyLock { data: (None, f) }
}
}

struct A<T = i32>(Option<T>);

impl<T> Default for A<T> {
fn default() -> Self {
A(None)
}
}

static EMPTY_SET: LazyLock<A<i32>> = LazyLock::new(A::default);

fn main() {}
14 changes: 14 additions & 0 deletions tests/crashes/124189.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@ known-bug: #124189
trait Trait {
type Type;
}

impl<T> Trait for T {
type Type = ();
}

fn f(_: <&Copy as Trait>::Type) {}

fn main() {
f(());
}
9 changes: 9 additions & 0 deletions tests/crashes/124207.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ known-bug: #124207
#![feature(transmutability)]
#![feature(type_alias_impl_trait)]
trait OpaqueTrait {}
type OpaqueType = impl OpaqueTrait;
trait AnotherTrait {}
impl<T: std::mem::BikeshedIntrinsicFrom<(), ()>> AnotherTrait for T {}
impl AnotherTrait for OpaqueType {}
pub fn main() {}
Loading