Skip to content

Commit 213887d

Browse files
authored
Unrolled build for rust-lang#136068
Rollup merge of rust-lang#136068 - matthiaskrgr:crashesjan25, r=Mark-Simulacrum crashes: more tests try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl
2 parents 124cc92 + fb52da3 commit 213887d

File tree

11 files changed

+202
-0
lines changed

11 files changed

+202
-0
lines changed

Diff for: tests/crashes/135470.rs

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//@ known-bug: #135470
2+
//@ compile-flags: --edition=2021 -Copt-level=0
3+
4+
use std::future::Future;
5+
trait Access {
6+
type Lister;
7+
8+
fn list() -> impl Future<Output = Self::Lister> {
9+
async { todo!() }
10+
}
11+
}
12+
13+
trait Foo {}
14+
impl Access for dyn Foo {
15+
type Lister = ();
16+
}
17+
18+
fn main() {
19+
let svc = async {
20+
async { <dyn Foo>::list() }.await;
21+
};
22+
&svc as &dyn Service;
23+
}
24+
25+
trait UnaryService {
26+
fn call2() {}
27+
}
28+
trait Unimplemented {}
29+
impl<T: Unimplemented> UnaryService for T {}
30+
struct Wrap<T>(T);
31+
impl<T: Send> UnaryService for Wrap<T> {}
32+
33+
trait Service {
34+
fn call(&self);
35+
}
36+
impl<T: Send> Service for T {
37+
fn call(&self) {
38+
Wrap::<T>::call2();
39+
}
40+
}

Diff for: tests/crashes/135528.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ known-bug: #135528
2+
//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes
3+
#![feature(type_alias_impl_trait)]
4+
type Tait = impl Copy;
5+
6+
fn set(x: &isize) -> isize {
7+
*x
8+
}
9+
10+
fn d(x: Tait) {
11+
set(x);
12+
}
13+
14+
fn other_define() -> Tait {
15+
()
16+
}
17+
18+
fn main() {}

Diff for: tests/crashes/135570.rs

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

Diff for: tests/crashes/135617.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: #135617
2+
trait Project {
3+
const ASSOC: usize;
4+
}
5+
6+
fn foo()
7+
where
8+
for<'a> (): Project,
9+
{
10+
[(); <() as Project>::ASSOC];
11+
}
12+
13+
pub fn main() {}

Diff for: tests/crashes/135646.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ known-bug: #135646
2+
//@ compile-flags: --edition=2024 -Zpolonius=next
3+
fn main() {
4+
&{ [1, 2, 3][4] };
5+
}

Diff for: tests/crashes/135668.rs

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//@ known-bug: #135668
2+
//@ compile-flags: --edition=2021
3+
use std::future::Future;
4+
5+
pub async fn foo() {
6+
let _ = create_task().await;
7+
}
8+
9+
async fn create_task() -> impl Sized {
10+
bind(documentation)
11+
}
12+
13+
async fn documentation() {
14+
include_str!("nonexistent");
15+
}
16+
17+
fn bind<F>(_filter: F) -> impl Sized
18+
where
19+
F: FilterBase,
20+
{
21+
|| -> <F as FilterBase>::Assoc { panic!() }
22+
}
23+
24+
trait FilterBase {
25+
type Assoc;
26+
}
27+
28+
impl<F, R> FilterBase for F
29+
where
30+
F: Fn() -> R,
31+
// Removing the below line makes it correctly error on both stable and beta
32+
R: Future,
33+
// Removing the below line makes it ICE on both stable and beta
34+
R: Send,
35+
// Removing the above two bounds makes it ICE on stable but correctly error on beta
36+
{
37+
type Assoc = F;
38+
}

Diff for: tests/crashes/135718.rs

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//@ known-bug: #135718
2+
3+
struct Equal;
4+
5+
struct Bar;
6+
7+
trait TwiceNested {}
8+
impl<M> TwiceNested for Bar where Bar: NestMakeEqual<NestEq = M> {}
9+
10+
struct Sum;
11+
12+
trait Not {
13+
fn not();
14+
}
15+
16+
impl<P> Not for Sum
17+
where
18+
Bar: NestMakeEqual<NestEq = P>,
19+
Self: Problem<P>,
20+
{
21+
fn not() {}
22+
}
23+
24+
trait NestMakeEqual {
25+
type NestEq;
26+
}
27+
28+
trait MakeEqual {
29+
type Eq;
30+
}
31+
32+
struct Foo;
33+
impl MakeEqual for Foo {
34+
type Eq = Equal;
35+
}
36+
37+
impl<O> NestMakeEqual for Bar
38+
where
39+
Foo: MakeEqual<Eq = O>,
40+
{
41+
type NestEq = O;
42+
}
43+
44+
trait Problem<M> {}
45+
impl Problem<()> for Sum where Bar: TwiceNested {}
46+
impl Problem<Equal> for Sum where Bar: TwiceNested {}
47+
48+
fn main() {
49+
Sum::not();
50+
}

Diff for: tests/crashes/135720.rs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//@ known-bug: #135720
2+
#![feature(generic_const_exprs)]
3+
type S<'l> = [i32; A];
4+
fn lint_me(x: S<()>) {}

Diff for: tests/crashes/135845.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: #135845
2+
struct S<'a, T: ?Sized>(&'a T);
3+
4+
fn b<'a>() -> S<'static, _> {
5+
S::<'a>(&0)
6+
}

Diff for: tests/crashes/135863.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: #135863
2+
struct A;
3+
4+
impl A {
5+
fn len(self: &&B) {}
6+
}
7+
8+
fn main() {
9+
A.len()
10+
}

Diff for: tests/crashes/136063.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: #136063
2+
#![feature(generic_const_exprs)]
3+
trait A<const B: u8 = X> {}
4+
impl A<1> for bool {}
5+
fn bar(arg : &dyn A<x>) { bar(true) }
6+
pub fn main() {}

0 commit comments

Comments
 (0)