Skip to content

Commit 5fa740f

Browse files
authoredAug 5, 2024
Rollup merge of rust-lang#128660 - matthiaskrgr:niceice, r=compiler-errors
tests: more crashes r? ``@jieyouxu``
2 parents 227944d + 69de294 commit 5fa740f

File tree

7 files changed

+87
-0
lines changed

7 files changed

+87
-0
lines changed
 

‎tests/crashes/128094.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: rust-lang/rust#128094
2+
//@ compile-flags: -Zmir-opt-level=5 --edition=2018
3+
4+
pub enum Request {
5+
TestSome(T),
6+
}
7+
8+
pub async fn handle_event(event: Request) {
9+
async move {
10+
static instance: Request = Request { bar: 17 };
11+
&instance
12+
}
13+
.await;
14+
}

‎tests/crashes/128176.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: rust-lang/rust#128176
2+
3+
#![feature(generic_const_exprs)]
4+
#![feature(object_safe_for_dispatch)]
5+
trait X {
6+
type Y<const N: i16>;
7+
}
8+
9+
const _: () = {
10+
fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
11+
};
12+
13+
fn main() {}

‎tests/crashes/128190.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: rust-lang/rust#128190
2+
3+
fn a(&self) {
4+
15
5+
}
6+
7+
reuse a as b { struct S; }

‎tests/crashes/128327.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ known-bug: rust-lang/rust#128327
2+
3+
use std::ops::Deref;
4+
struct Apple((Apple, <&'static [f64] as Deref>::Target(Banana ? Citron)));
5+
fn main(){}

‎tests/crashes/128346.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: rust-lang/rust#128346
2+
3+
macro_rules! one_rep {
4+
( $($a:ident)* ) => {
5+
A(
6+
const ${concat($a, Z)}: i32 = 3;
7+
)*
8+
};
9+
}
10+
11+
fn main() {
12+
one_rep!(A B C);
13+
}

‎tests/crashes/128621-2.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: rust-lang/rust#128621
2+
3+
#![feature(ptr_metadata)]
4+
use std::{ops::FnMut, ptr::Pointee};
5+
6+
pub type EmplacerFn<'a, T> = dyn for<'b> FnMut(<T as Pointee>::Metadata) + 'a;
7+
8+
pub struct Emplacer<'a, T>(EmplacerFn<'a, T>);
9+
10+
impl<'a, T> Emplacer<'a, T> {
11+
pub unsafe fn from_fn<'b>(emplacer_fn: &'b mut EmplacerFn<'a, T>) -> &'b mut Self {
12+
unsafe { &mut *((emplacer_fn as *mut EmplacerFn<'a, T>) as *mut Self) }
13+
}
14+
}
15+
16+
pub fn main() {}

‎tests/crashes/128621.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//@ known-bug: rust-lang/rust#128621
2+
3+
trait Trait {
4+
type Associated;
5+
}
6+
7+
impl Trait for i32 {
8+
type Associated = i64;
9+
}
10+
11+
trait Generic<T> {}
12+
13+
type TraitObject = dyn Generic<<i32 as Trait>::Associated>;
14+
15+
struct Wrap(TraitObject);
16+
17+
fn cast(x: *mut TraitObject) {
18+
x as *mut Wrap;
19+
}

0 commit comments

Comments
 (0)
Please sign in to comment.