Skip to content

Commit b3da6be

Browse files
authored
Rollup merge of rust-lang#126560 - matthiaskrgr:morecrashes, r=jieyouxu
more ice tests r? `@jieyouxu`
2 parents b2e34b1 + ff096f8 commit b3da6be

13 files changed

+222
-0
lines changed

tests/crashes/126062.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: rust-lang/rust#126062
2+
struct Fail<T>(Fail);
3+
impl<T> Fail<i32> {
4+
const C: () = panic!();
5+
}
6+
7+
fn f<T>() {
8+
if false {
9+
let _val = &Fail::<T>::C;
10+
}
11+
}

tests/crashes/126148.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//@ known-bug: rust-lang/rust#126148
2+
3+
#![feature(effects)]
4+
use std::ops::{FromResidual, Try};
5+
6+
struct TryMe;
7+
struct Error;
8+
9+
impl const FromResidual<Error> for TryMe {}
10+
11+
impl const Try for TryMe {
12+
type Output = ();
13+
type Residual = Error;
14+
}
15+
16+
const fn t() -> TryMe {
17+
TryMe?;
18+
TryMe
19+
}
20+
21+
const _: () = {
22+
t();
23+
};

tests/crashes/126182.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: rust-lang/rust#126182
2+
3+
#![feature(generic_const_exprs)]
4+
#![allow(incomplete_features)]
5+
6+
struct Cond<const B: bool>;
7+
8+
struct Thing<T = Cond<0>>(T);
9+
10+
impl Thing {}

tests/crashes/126267.rs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//@ known-bug: rust-lang/rust#126267
2+
3+
#![feature(transmutability)]
4+
#![crate_type = "lib"]
5+
6+
pub enum ApiError {}
7+
pub struct TokioError {
8+
b: bool,
9+
}
10+
pub enum Error {
11+
Api { source: ApiError },
12+
Ethereum,
13+
Tokio { source: TokioError },
14+
}
15+
16+
mod assert {
17+
use std::mem::BikeshedIntrinsicFrom;
18+
19+
pub fn is_transmutable<Src, Dst>()
20+
where
21+
Dst: BikeshedIntrinsicFrom<Src>, // safety is NOT assumed
22+
{
23+
}
24+
}
25+
26+
fn test() {
27+
struct Src;
28+
type Dst = Error;
29+
assert::is_transmutable::<Src, Dst>();
30+
}

tests/crashes/126269.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: rust-lang/rust#126269
2+
#![feature(coerce_unsized)]
3+
4+
pub enum Foo<T> {
5+
Bar([T; usize::MAX]),
6+
}
7+
8+
use std::ops::CoerceUnsized;
9+
10+
impl<T, U> CoerceUnsized<U> for T {}
11+
12+
fn main() {}

tests/crashes/126272.rs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//@ known-bug: rust-lang/rust#126272
2+
3+
#![feature(adt_const_params)]
4+
#![allow(incomplete_features)]
5+
6+
use std::marker::ConstParamTy;
7+
8+
#[derive(Debug, PartialEq, Eq, ConstParamTy)]
9+
struct Foo {
10+
value: i32,
11+
nested: &'static Bar<std::fmt::Debug>,
12+
}
13+
14+
#[derive(Debug, PartialEq, Eq, ConstParamTy)]
15+
struct Bar<T>(T);
16+
17+
struct Test<const F: Foo>;
18+
19+
fn main() {
20+
let x: Test<
21+
{
22+
Foo {
23+
value: 3,
24+
nested: &Bar(4),
25+
}
26+
},
27+
> = Test;
28+
}

tests/crashes/126359.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ known-bug: rust-lang/rust#126359
2+
3+
struct OppOrder<const N: u8 = 3, T = u32> {
4+
arr: [T; N],
5+
}
6+
7+
fn main() {
8+
let _ = OppOrder::<3, u32> { arr: [0, 0, 0] };
9+
}

tests/crashes/126376.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: rust-lang/rust#126376
2+
mod a {
3+
pub mod b {
4+
pub mod c {
5+
pub trait D {}
6+
}
7+
}
8+
}
9+
10+
use a::*;
11+
use e as b;
12+
use b::c::D as e;
13+
14+
fn e() {}

tests/crashes/126377.rs

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//@ known-bug: rust-lang/rust#126377
2+
3+
#![feature(effects)]
4+
#![feature(generic_const_exprs)]
5+
6+
mod assert {
7+
use std::mem::{Assume, BikeshedIntrinsicFrom};
8+
9+
pub fn is_transmutable<
10+
Src,
11+
Dst,
12+
const ASSUME_ALIGNMENT: bool,
13+
const ASSUME_LIFETIMES: bool,
14+
const ASSUME_SAFETY: bool,
15+
const ASSUME_VALIDITY: bool,
16+
>()
17+
where
18+
Dst: BikeshedIntrinsicFrom<
19+
Src,
20+
{ }
21+
>,
22+
{}
23+
}
24+
25+
const fn from_options() -> Assume {
26+
#[repr(C)] struct Src;
27+
#[repr(C)] struct Dst;
28+
assert::is_transmutable::<Src, Dst, {0u8}, false, false, false>();
29+
}

tests/crashes/126385.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: rust-lang/rust#126385
2+
pub struct MyStruct<'field> {
3+
field: &'_ [u32],
4+
}
5+
6+
impl MyStruct<'_> {
7+
pub fn _<'a>(field: &'a[u32]) -> Self<new> {
8+
Self{field}
9+
}
10+
}

tests/crashes/126389.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: rust-lang/rust#126389
2+
3+
mod a {
4+
pub mod b {
5+
pub mod c {}
6+
}
7+
}
8+
9+
use a::*;
10+
11+
use b::c;
12+
13+
use c as b;
14+
15+
fn c() {}

tests/crashes/126416.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ known-bug: rust-lang/rust#126416
2+
3+
trait Output<'a, T: 'a> {
4+
type Type;
5+
}
6+
7+
struct Wrapper;
8+
9+
impl Wrapper {
10+
fn do_something_wrapper<O, F>(&mut self, _: F)
11+
where
12+
F: for<'a> FnOnce(<F as Output<i32>>::Type),
13+
{
14+
}
15+
}
16+
17+
fn main() {
18+
let mut wrapper = Wrapper;
19+
wrapper.do_something_wrapper(|value| ());
20+
}

tests/crashes/126521.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: rust-lang/rust#126521
2+
macro_rules! foo {
3+
($val:ident) => {
4+
true;
5+
};
6+
}
7+
8+
fn main() {
9+
#[expect(semicolon_in_expressions_from_macros)]
10+
let _ = foo!(x);
11+
}

0 commit comments

Comments
 (0)