Skip to content

Commit 862f3e7

Browse files
authored
Rollup merge of rust-lang#130491 - matthiaskrgr:sehsarc, r=compiler-errors
more crash tests r? `@compiler-errors`
2 parents 32c4d41 + 12814c8 commit 862f3e7

File tree

7 files changed

+97
-0
lines changed

7 files changed

+97
-0
lines changed

tests/crashes/120016.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//@ known-bug: #120016
2+
//@ compile-flags: -Zcrate-attr=feature(const_async_blocks) --edition=2021
3+
4+
#![feature(type_alias_impl_trait, const_async_blocks)]
5+
6+
struct Bug {
7+
V1: [(); {
8+
type F = impl std::future::Future<Output = impl Sized>;
9+
fn concrete_use() -> F {
10+
//~^ ERROR to be a future that resolves to `u8`, but it resolves to `()`
11+
async {}
12+
}
13+
let f: F = async { 1 };
14+
//~^ ERROR `async` blocks are not allowed in constants
15+
1
16+
}],
17+
}
18+
19+
fn main() {}

tests/crashes/127804.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: #127804
2+
3+
struct Thing;
4+
5+
pub trait Every {
6+
type Assoc;
7+
}
8+
impl<T: ?Sized> Every for Thing {
9+
type Assoc = T;
10+
}
11+
12+
fn foo(_: <Thing as Every>::Assoc) {}

tests/crashes/128119.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: #128119
2+
3+
trait Trait {
4+
reuse to_reuse::foo { self }
5+
}
6+
7+
struct S;
8+
9+
mod to_reuse {
10+
pub fn foo(&self) -> u32 {}
11+
}
12+
13+
impl Trait S {
14+
reuse to_reuse::foo { self }
15+
}

tests/crashes/128232.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: #128232
2+
3+
#![feature(generic_const_exprs, unsized_const_params)]
4+
5+
fn function() {}
6+
7+
struct Wrapper<const F: fn()>;
8+
9+
impl Wrapper<{ bar() }> {
10+
fn call() {}
11+
}
12+
13+
fn main() {
14+
Wrapper::<function>::call;
15+
}

tests/crashes/130411.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: #130411
2+
trait Project {
3+
const SELF: Self;
4+
}
5+
6+
fn take1(_: Project<SELF = {}>) {}

tests/crashes/130413.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ known-bug: #130413
2+
3+
#![feature(transmutability)]
4+
trait Aaa {
5+
type Y;
6+
}
7+
8+
trait Bbb {
9+
type B: std::mem::TransmuteFrom<()>;
10+
}
11+
12+
impl<T> Bbb for T
13+
where
14+
T: Aaa,
15+
{
16+
type B = T::Y;
17+
}

tests/crashes/130425.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #130425
2+
//@ compile-flags: -Zmir-opt-level=5 -Zpolymorphize=on
3+
4+
struct S<T>(T)
5+
where
6+
[T; (
7+
|_: u8| {
8+
static FOO: Sync = AtomicUsize::new(0);
9+
unsafe { &*(&FOO as *const _ as *const usize) }
10+
},
11+
1,
12+
)
13+
.1]: Copy;

0 commit comments

Comments
 (0)