forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#128660 - matthiaskrgr:niceice, r=compiler-e…
…rrors tests: more crashes r? `@jieyouxu`
- Loading branch information
Showing
7 changed files
with
87 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,14 @@ | ||
//@ known-bug: rust-lang/rust#128094 | ||
//@ compile-flags: -Zmir-opt-level=5 --edition=2018 | ||
|
||
pub enum Request { | ||
TestSome(T), | ||
} | ||
|
||
pub async fn handle_event(event: Request) { | ||
async move { | ||
static instance: Request = Request { bar: 17 }; | ||
&instance | ||
} | ||
.await; | ||
} |
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,13 @@ | ||
//@ known-bug: rust-lang/rust#128176 | ||
|
||
#![feature(generic_const_exprs)] | ||
#![feature(object_safe_for_dispatch)] | ||
trait X { | ||
type Y<const N: i16>; | ||
} | ||
|
||
const _: () = { | ||
fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {} | ||
}; | ||
|
||
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,7 @@ | ||
//@ known-bug: rust-lang/rust#128190 | ||
|
||
fn a(&self) { | ||
15 | ||
} | ||
|
||
reuse a as b { struct S; } |
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,5 @@ | ||
//@ known-bug: rust-lang/rust#128327 | ||
|
||
use std::ops::Deref; | ||
struct Apple((Apple, <&'static [f64] as Deref>::Target(Banana ? Citron))); | ||
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,13 @@ | ||
//@ known-bug: rust-lang/rust#128346 | ||
|
||
macro_rules! one_rep { | ||
( $($a:ident)* ) => { | ||
A( | ||
const ${concat($a, Z)}: i32 = 3; | ||
)* | ||
}; | ||
} | ||
|
||
fn main() { | ||
one_rep!(A B C); | ||
} |
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,16 @@ | ||
//@ known-bug: rust-lang/rust#128621 | ||
|
||
#![feature(ptr_metadata)] | ||
use std::{ops::FnMut, ptr::Pointee}; | ||
|
||
pub type EmplacerFn<'a, T> = dyn for<'b> FnMut(<T as Pointee>::Metadata) + 'a; | ||
|
||
pub struct Emplacer<'a, T>(EmplacerFn<'a, T>); | ||
|
||
impl<'a, T> Emplacer<'a, T> { | ||
pub unsafe fn from_fn<'b>(emplacer_fn: &'b mut EmplacerFn<'a, T>) -> &'b mut Self { | ||
unsafe { &mut *((emplacer_fn as *mut EmplacerFn<'a, T>) as *mut Self) } | ||
} | ||
} | ||
|
||
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,19 @@ | ||
//@ known-bug: rust-lang/rust#128621 | ||
|
||
trait Trait { | ||
type Associated; | ||
} | ||
|
||
impl Trait for i32 { | ||
type Associated = i64; | ||
} | ||
|
||
trait Generic<T> {} | ||
|
||
type TraitObject = dyn Generic<<i32 as Trait>::Associated>; | ||
|
||
struct Wrap(TraitObject); | ||
|
||
fn cast(x: *mut TraitObject) { | ||
x as *mut Wrap; | ||
} |