forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#129869 - cyrgani:master, r=Mark-Simulacrum add a few more crashtests Added them for rust-lang#123629, rust-lang#127033 and rust-lang#129372.
- Loading branch information
Showing
3 changed files
with
80 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,10 @@ | ||
//@ known-bug: #123629 | ||
#![feature(generic_assert)] | ||
|
||
fn foo() | ||
where | ||
for<const N: usize = { assert!(u) }> ():, | ||
{ | ||
} | ||
|
||
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,18 @@ | ||
//@ known-bug: #127033 | ||
//@ compile-flags: --edition=2021 | ||
|
||
pub trait RaftLogStorage { | ||
fn save_vote(vote: ()) -> impl std::future::Future + Send; | ||
} | ||
|
||
struct X; | ||
impl RaftLogStorage for X { | ||
fn save_vote(vote: ()) -> impl std::future::Future { | ||
loop {} | ||
async { | ||
vote | ||
} | ||
} | ||
} | ||
|
||
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,52 @@ | ||
//@ known-bug: #129372 | ||
//@ compile-flags: -Cdebuginfo=2 -Copt-level=0 | ||
|
||
pub struct Wrapper<T>(T); | ||
struct Struct; | ||
|
||
pub trait TraitA { | ||
type AssocA<'t>; | ||
} | ||
pub trait TraitB { | ||
type AssocB; | ||
} | ||
|
||
pub fn helper(v: impl MethodTrait) { | ||
let _local_that_causes_ice = v.method(); | ||
} | ||
|
||
pub fn main() { | ||
helper(Wrapper(Struct)); | ||
} | ||
|
||
pub trait MethodTrait { | ||
type Assoc<'a>; | ||
|
||
fn method(self) -> impl for<'a> FnMut(&'a ()) -> Self::Assoc<'a>; | ||
} | ||
|
||
impl<T: TraitB> MethodTrait for T | ||
where | ||
<T as TraitB>::AssocB: TraitA, | ||
{ | ||
type Assoc<'a> = <T::AssocB as TraitA>::AssocA<'a>; | ||
|
||
fn method(self) -> impl for<'a> FnMut(&'a ()) -> Self::Assoc<'a> { | ||
move |_| loop {} | ||
} | ||
} | ||
|
||
impl<T, B> TraitB for Wrapper<B> | ||
where | ||
B: TraitB<AssocB = T>, | ||
{ | ||
type AssocB = T; | ||
} | ||
|
||
impl TraitB for Struct { | ||
type AssocB = Struct; | ||
} | ||
|
||
impl TraitA for Struct { | ||
type AssocA<'t> = Self; | ||
} |