Skip to content

Commit f6bed70

Browse files
authored
Rollup merge of rust-lang#135061 - matthiaskrgr:crashes_jan, r=lqd
crashes: add latest batch of tests try-job: aarch64-apple try-job: x86_64-msvc try-job: x86_64-gnu
2 parents e4f4da1 + 5397616 commit f6bed70

File tree

11 files changed

+183
-0
lines changed

11 files changed

+183
-0
lines changed

tests/crashes/134336.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: #134336
2+
#![expect(incomplete_features)]
3+
#![feature(explicit_tail_calls)]
4+
5+
trait Tr {
6+
fn f();
7+
}
8+
9+
fn g<T: Tr>() {
10+
become T::f();
11+
}

tests/crashes/134355.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: #134355
2+
3+
//@compile-flags: --crate-type=lib
4+
fn digit() -> str {
5+
return { i32::MIN };
6+
}

tests/crashes/134479.rs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//@ known-bug: #134479
2+
//@ compile-flags: -Csymbol-mangling-version=v0 -Cdebuginfo=1
3+
4+
#![feature(generic_const_exprs)]
5+
6+
fn main() {
7+
test::<2>();
8+
}
9+
10+
struct Test<const N: usize>;
11+
12+
fn new<const N: usize>() -> Test<N>
13+
where
14+
[(); N * 1]: Sized,
15+
{
16+
Test
17+
}
18+
19+
fn test<const N: usize>() -> Test<{ N - 1 }>
20+
where
21+
[(); (N - 1) * 1]: Sized,
22+
{
23+
new()
24+
}

tests/crashes/134587.rs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//@ known-bug: #134587
2+
3+
use std::ops::Add;
4+
5+
pub fn foo<T>(slf: *const T)
6+
where
7+
*const T: Add,
8+
{
9+
slf + slf;
10+
}
11+
12+
pub fn foo2<T>(slf: *const T)
13+
where
14+
*const T: Add<u8>,
15+
{
16+
slf + 1_u8;
17+
}
18+
19+
20+
pub trait TimesTwo
21+
where *const Self: Add<*const Self>,
22+
{
23+
extern "C" fn t2_ptr(slf: *const Self)
24+
-> <*const Self as Add<*const Self>>::Output {
25+
slf + slf
26+
}
27+
}

tests/crashes/134615.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: #134615
2+
3+
#![feature(generic_const_exprs)]
4+
5+
trait Trait {
6+
const CONST: usize;
7+
}
8+
9+
fn f()
10+
where
11+
for<'a> (): Trait,
12+
[(); <() as Trait>::CONST]:,
13+
{
14+
}
15+
16+
pub fn main() {}

tests/crashes/134641.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #134641
2+
#![feature(associated_const_equality)]
3+
4+
pub trait IsVoid {
5+
const IS_VOID: bool;
6+
}
7+
impl IsVoid for () {
8+
const IS_VOID: bool = true;
9+
}
10+
11+
pub trait Maybe {}
12+
impl Maybe for () {}
13+
impl Maybe for () where (): IsVoid<IS_VOID = true> {}

tests/crashes/134654.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: #134654
2+
//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+Inline -Zvalidate-mir
3+
4+
fn function_with_bytes<const BYTES:
5+
&'static [u8; 0xa9008fb6c9d81e42_0e25730562a601c8_u128]>() -> &'static [u8] {
6+
BYTES
7+
}
8+
9+
fn main() {
10+
function_with_bytes::<b"aa">() == &[];
11+
}

tests/crashes/134838.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: #134838
2+
#![feature(type_ascription)]
3+
#![allow(dead_code)]
4+
5+
struct Ty(());
6+
7+
fn mk() -> impl Sized {
8+
if false {
9+
let _ = type_ascribe!(mk(), Ty).0;
10+
}
11+
Ty(())
12+
}
13+
14+
fn main() {}

tests/crashes/134905.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ known-bug: #134905
2+
3+
trait Iterate<'a> {
4+
type Ty: Valid;
5+
}
6+
impl<'a, T> Iterate<'a> for T
7+
where
8+
T: Check,
9+
{
10+
default type Ty = ();
11+
}
12+
13+
trait Check {}
14+
impl<'a, T> Eq for T where <T as Iterate<'a>>::Ty: Valid {}
15+
16+
trait Valid {}

tests/crashes/135020.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ known-bug: #135020
2+
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+
}
10+
11+
pub fn main() {}

tests/crashes/135039.rs

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//@ known-bug: #135039
2+
//@ edition:2021
3+
4+
pub type UserId<Backend> = <<Backend as AuthnBackend>::User as AuthUser>::Id;
5+
6+
pub trait AuthUser {
7+
type Id;
8+
}
9+
10+
pub trait AuthnBackend {
11+
type User: AuthUser;
12+
}
13+
14+
pub struct AuthSession<Backend: AuthnBackend> {
15+
user: Option<Backend::User>,
16+
data: Option<UserId<Backend>>,
17+
}
18+
19+
pub trait Authz: Sized {
20+
type AuthnBackend: AuthnBackend<User = Self>;
21+
}
22+
23+
pub trait Query<User: Authz> {
24+
type Output;
25+
async fn run(&self) -> Result<Self::Output, ()>;
26+
}
27+
28+
pub async fn run_query<User: Authz, Q: Query<User> + 'static>(
29+
auth: AuthSession<User::AuthnBackend>,
30+
query: Q,
31+
) -> Result<Q::Output, ()> {
32+
let user = auth.user;
33+
query.run().await
34+
}

0 commit comments

Comments
 (0)