Skip to content

Commit 088b125

Browse files
committed
crashes: couple more tests
1 parent 07292cc commit 088b125

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+569
-0
lines changed

tests/crashes/136138.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: #136138
2+
#![feature(min_generic_const_args)]
3+
struct U;
4+
struct S<const N: U>()
5+
where
6+
S<{ U }>:;
7+
fn main() {}

tests/crashes/136175-2.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #136175
2+
#![feature(generic_const_exprs)]
3+
#![allow(incomplete_features)]
4+
5+
trait Trait {}
6+
7+
struct A<T>(T)
8+
where
9+
[(); std::mem::offset_of!((T,), 0)]:;
10+
11+
fn main() {
12+
let x: A<dyn Trait>;
13+
}

tests/crashes/136175.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #136175
2+
#![feature(generic_const_exprs)]
3+
#![allow(incomplete_features)]
4+
5+
trait Trait {}
6+
7+
struct A<T>(T)
8+
where
9+
[(); size_of::<T>()]:;
10+
11+
fn main() {
12+
let x: A<dyn Trait>;
13+
}

tests/crashes/136188.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: #136188
2+
//@ compile-flags: --crate-type=lib -Znext-solver
3+
#![feature(type_alias_impl_trait)]
4+
5+
type Opaque = Box<impl Sized>;
6+
7+
fn define() -> Opaque { Box::new(()) }
8+
9+
impl Copy for Opaque {}

tests/crashes/136286.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ known-bug: #136286
2+
//@ compile-flags: --edition=2024
3+
4+
#![feature(async_fn_in_dyn_trait)]
5+
trait A {
6+
async fn b(self: A);
7+
}

tests/crashes/136379.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: #136379
2+
#![feature(min_generic_const_args)]
3+
pub struct S();
4+
5+
impl S {
6+
pub fn f() -> [u8; S] {
7+
[]
8+
}
9+
}
10+
11+
pub fn main() {}

tests/crashes/136381.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ known-bug: #136381
2+
//@ compile-flags: -Zvalidate-mir -Zmir-enable-passes=+GVN
3+
#![feature(trait_upcasting)]
4+
5+
trait A {}
6+
trait B: A {
7+
fn c(&self);
8+
}
9+
impl B for i32 {
10+
fn c(self) {
11+
todo!();
12+
}
13+
}
14+
15+
fn main() {
16+
let baz: &dyn B = &1;
17+
let bar: &dyn A = baz;
18+
}

tests/crashes/136416.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: #136416
2+
#![feature(generic_const_exprs)]
3+
struct State<const S : usize = {}> where[(); S] :;
4+
5+
struct Foo;
6+
struct State2<const S: usize = Foo> where [(); S]:;

tests/crashes/136442.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: #136442
2+
//@ compile-flags: -Copt-level=0 -Zmir-enable-passes=+Inline -Zmir-enable-passes=+JumpThreading --crate-type lib
3+
pub fn problem_thingy(items: &mut impl Iterator<Item = str>) {
4+
let mut peeker = items.peekable();
5+
match peeker.peek() {
6+
Some(_) => (),
7+
None => return (),
8+
}
9+
}

tests/crashes/136661.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//@ known-bug: #136661
2+
3+
#![allow(unused)]
4+
5+
trait Supertrait<T> {}
6+
7+
trait Other {
8+
fn method(&self) {}
9+
}
10+
11+
impl WithAssoc for &'static () {
12+
type As = ();
13+
}
14+
15+
trait WithAssoc {
16+
type As;
17+
}
18+
19+
trait Trait<P: WithAssoc>: Supertrait<P::As> {
20+
fn method(&self) {}
21+
}
22+
23+
fn hrtb<T: for<'a> Trait<&'a ()>>() {}
24+
25+
pub fn main() {}

0 commit comments

Comments
 (0)