-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #124236 - matthiaskrgr:n-ice, r=jieyouxu
crashes: add a couple more ICE tests
- Loading branch information
Showing
6 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |