Skip to content

Commit dca9b0e

Browse files
committed
add several older crashtests
1 parent 3391c01 commit dca9b0e

File tree

6 files changed

+78
-0
lines changed

6 files changed

+78
-0
lines changed

tests/crashes/114880.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: #114880
2+
//@ proc-macro: aux114880.rs
3+
//@ ignore-backends: gcc
4+
5+
aux114880::expand!();
6+
7+
fn main() {}

tests/crashes/119940.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//@ known-bug: #119940
2+
//@ compile-flags: -Zvalidate-mir
3+
4+
#![feature(custom_mir, core_intrinsics)]
5+
extern crate core;
6+
use core::intrinsics::mir::*;
7+
8+
pub enum E {
9+
V0 { fld0: &'static u64 },
10+
}
11+
12+
#[custom_mir(dialect = "runtime", phase = "initial")]
13+
pub fn fn0() {
14+
mir! {
15+
let e: E;
16+
let n: u64;
17+
{
18+
n = 0;
19+
place!(Field::<&u64>(Variant(e, 0), 0)) = &n;
20+
Return()
21+
}
22+
23+
}
24+
}
25+
pub fn main() {
26+
fn0();
27+
}

tests/crashes/126418.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: #126418
2+
//@ compile-flags: --crate-type=lib
3+
//@ only-x86_64
4+
//@ ignore-backends: gcc
5+
#![feature(abi_x86_interrupt)]
6+
pub extern "x86-interrupt" fn f(_: ()) {}

tests/crashes/138274.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ known-bug: #138274
2+
//@ edition: 2021
3+
//@ compile-flags: --crate-type=lib
4+
trait Trait {}
5+
6+
fn foo() -> Box<dyn Trait> {
7+
todo!()
8+
}
9+
10+
fn fetch() {
11+
async {
12+
let fut = async {
13+
let _x = foo();
14+
async {}.await;
15+
};
16+
let _: Box<dyn Send> = Box::new(fut);
17+
};
18+
}

tests/crashes/138660.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: #138660
2+
enum A {
3+
V1(isize) = 1..=10,
4+
V0 = 1..=10,
5+
}
6+
const B: &'static [A] = &[A::V0, A::V1(111)];
7+
fn main() {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(proc_macro_expand)]
2+
#![crate_type = "proc-macro"]
3+
4+
extern crate proc_macro;
5+
use std::str::FromStr;
6+
7+
use proc_macro::TokenStream;
8+
9+
#[proc_macro]
10+
pub fn expand(_: TokenStream) -> TokenStream {
11+
dbg!(TokenStream::from_str("include!(\"./doesnt_exist\")").unwrap().expand_expr())
12+
.unwrap_or_default()
13+
}

0 commit comments

Comments
 (0)