Skip to content

Commit 71213fd

Browse files
committed
Auto merge of #125539 - matthiaskrgr:cräsh, r=jieyouxu
crashes: increment the number of tracked ones r? `@jieyouxu`
2 parents 84b40fc + bae9452 commit 71213fd

15 files changed

+305
-1
lines changed

tests/crashes/123255.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ known-bug: rust-lang/rust#123255
2+
//@ edition:2021
3+
#![crate_type = "lib"]
4+
5+
pub fn a() {}
6+
7+
mod handlers {
8+
pub struct C(&());
9+
pub fn c() -> impl Fn() -> C {
10+
let a1 = ();
11+
|| C((crate::a(), a1).into())
12+
}
13+
}

tests/crashes/123276.rs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//@ known-bug: rust-lang/rust#123276
2+
//@ edition:2021
3+
4+
async fn create_task() {
5+
_ = Some(async { bind(documentation_filter()) });
6+
}
7+
8+
async fn bind<Fut, F: Filter<Future = Fut>>(_: F) {}
9+
10+
fn documentation_filter() -> impl Filter {
11+
AndThen
12+
}
13+
14+
trait Filter {
15+
type Future;
16+
}
17+
18+
struct AndThen;
19+
20+
impl Filter for AndThen
21+
where
22+
Foo: Filter,
23+
{
24+
type Future = ();
25+
}

tests/crashes/123887.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: rust-lang/rust#123887
2+
//@ compile-flags: -Clink-dead-code
3+
4+
#![feature(extern_types)]
5+
#![feature(unsized_fn_params)]
6+
7+
extern "C" {
8+
pub type ExternType;
9+
}
10+
11+
impl ExternType {
12+
pub fn f(self) {}
13+
}
14+
15+
pub fn main() {}

tests/crashes/125013-1.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ known-bug: rust-lang/rust#125013
2+
//@ edition:2021
3+
use io::{self as std};
4+
use std::ops::Deref::{self as io};
5+
pub fn main() {}

tests/crashes/125013-2.rs

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

tests/crashes/125014.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ known-bug: rust-lang/rust#125014
2+
//@ compile-flags: -Znext-solver=coherence
3+
#![feature(specialization)]
4+
5+
trait Foo {}
6+
7+
impl Foo for <u16 as Assoc>::Output {}
8+
9+
impl Foo for u32 {}
10+
11+
trait Assoc {
12+
type Output;
13+
}
14+
impl Output for u32 {}
15+
impl Assoc for <u16 as Assoc>::Output {
16+
default type Output = bool;
17+
}

tests/crashes/125059.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ known-bug: rust-lang/rust#125059
2+
#![feature(deref_patterns)]
3+
#![allow(incomplete_features)]
4+
5+
fn simple_vec(vec: Vec<u32>) -> u32 {
6+
(|| match Vec::<u32>::new() {
7+
deref!([]) => 100,
8+
_ => 2000,
9+
})()
10+
}
11+
12+
fn main() {}

tests/crashes/125323.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ known-bug: rust-lang/rust#125323
2+
fn main() {
3+
for _ in 0..0 {
4+
[(); loop {}];
5+
}
6+
}

tests/crashes/125476.rs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//@ known-bug: rust-lang/rust#125476
2+
//@ only-x86_64
3+
pub struct Data([u8; usize::MAX >> 16]);
4+
const _: &'static [Data] = &[];

tests/crashes/125512.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ known-bug: rust-lang/rust#125512
2+
//@ edition:2021
3+
#![feature(object_safe_for_dispatch)]
4+
trait B {
5+
fn f(a: A) -> A;
6+
}
7+
trait A {
8+
fn concrete(b: B) -> B;
9+
}
10+
fn main() {}

tests/crashes/125553.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ known-bug: rust-lang/rust#125553
2+
//@ edition:2021
3+
4+
#[derive(Copy, Clone)]
5+
struct Foo((u32, u32));
6+
7+
fn main() {
8+
type T = impl Copy(Copy, Clone)
9+
let foo: T = Foo((1u32, 1u32));
10+
let x = move || {
11+
let derive = move || {
12+
let Foo((a, b)) = foo;
13+
};
14+
};
15+
}

tests/crashes/125556.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ known-bug: rust-lang/rust#125556
2+
//@ compile-flags: -Znext-solver=coherence
3+
4+
#![feature(generic_const_exprs)]
5+
6+
pub struct A<const z: [usize; x]> {}
7+
8+
impl A<2> {
9+
pub const fn B() {}
10+
}
11+
12+
impl A<2> {
13+
pub const fn B() {}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// issue: rust-lang/rust#125520
2+
#![feature(generic_const_exprs)]
3+
//~^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
4+
5+
struct Outer<const A: i64, const B: i64>();
6+
impl<const A: usize, const B: usize> Outer<A, B>
7+
//~^ ERROR the constant `A` is not of type `i64`
8+
//~| ERROR the constant `B` is not of type `i64`
9+
//~| ERROR mismatched types
10+
//~| ERROR mismatched types
11+
where
12+
[(); A + (B * 2)]:,
13+
{
14+
fn i() -> Self {
15+
//~^ ERROR the constant `A` is not of type `i64`
16+
//~| ERROR the constant `B` is not of type `i64`
17+
Self
18+
//~^ ERROR mismatched types
19+
//~| ERROR the constant `A` is not of type `i64`
20+
//~| ERROR the constant `B` is not of type `i64`
21+
}
22+
}
23+
24+
fn main() {
25+
Outer::<1, 1>::o();
26+
//~^ ERROR no function or associated item named `o` found for struct `Outer` in the current scope
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:2:12
3+
|
4+
LL | #![feature(generic_const_exprs)]
5+
| ^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
10+
error: the constant `A` is not of type `i64`
11+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:6:38
12+
|
13+
LL | impl<const A: usize, const B: usize> Outer<A, B>
14+
| ^^^^^^^^^^^ expected `i64`, found `usize`
15+
|
16+
note: required by a bound in `Outer`
17+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:5:14
18+
|
19+
LL | struct Outer<const A: i64, const B: i64>();
20+
| ^^^^^^^^^^^^ required by this bound in `Outer`
21+
22+
error: the constant `B` is not of type `i64`
23+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:6:38
24+
|
25+
LL | impl<const A: usize, const B: usize> Outer<A, B>
26+
| ^^^^^^^^^^^ expected `i64`, found `usize`
27+
|
28+
note: required by a bound in `Outer`
29+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:5:28
30+
|
31+
LL | struct Outer<const A: i64, const B: i64>();
32+
| ^^^^^^^^^^^^ required by this bound in `Outer`
33+
34+
error: the constant `A` is not of type `i64`
35+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:14:15
36+
|
37+
LL | fn i() -> Self {
38+
| ^^^^ expected `i64`, found `usize`
39+
|
40+
note: required by a bound in `Outer`
41+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:5:14
42+
|
43+
LL | struct Outer<const A: i64, const B: i64>();
44+
| ^^^^^^^^^^^^ required by this bound in `Outer`
45+
46+
error: the constant `B` is not of type `i64`
47+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:14:15
48+
|
49+
LL | fn i() -> Self {
50+
| ^^^^ expected `i64`, found `usize`
51+
|
52+
note: required by a bound in `Outer`
53+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:5:28
54+
|
55+
LL | struct Outer<const A: i64, const B: i64>();
56+
| ^^^^^^^^^^^^ required by this bound in `Outer`
57+
58+
error[E0308]: mismatched types
59+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:17:9
60+
|
61+
LL | struct Outer<const A: i64, const B: i64>();
62+
| ---------------------------------------- `Outer` defines a struct constructor here, which should be called
63+
...
64+
LL | fn i() -> Self {
65+
| ---- expected `Outer<A, B>` because of return type
66+
...
67+
LL | Self
68+
| ^^^^ expected `Outer<A, B>`, found struct constructor
69+
|
70+
= note: expected struct `Outer<A, B>`
71+
found struct constructor `fn() -> Outer<A, B> {Outer::<A, B>}`
72+
help: use parentheses to construct this tuple struct
73+
|
74+
LL | Self()
75+
| ++
76+
77+
error: the constant `A` is not of type `i64`
78+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:17:9
79+
|
80+
LL | Self
81+
| ^^^^ expected `i64`, found `usize`
82+
|
83+
note: required by a bound in `Outer`
84+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:5:14
85+
|
86+
LL | struct Outer<const A: i64, const B: i64>();
87+
| ^^^^^^^^^^^^ required by this bound in `Outer`
88+
89+
error: the constant `B` is not of type `i64`
90+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:17:9
91+
|
92+
LL | Self
93+
| ^^^^ expected `i64`, found `usize`
94+
|
95+
note: required by a bound in `Outer`
96+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:5:28
97+
|
98+
LL | struct Outer<const A: i64, const B: i64>();
99+
| ^^^^^^^^^^^^ required by this bound in `Outer`
100+
101+
error[E0599]: no function or associated item named `o` found for struct `Outer` in the current scope
102+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:25:20
103+
|
104+
LL | struct Outer<const A: i64, const B: i64>();
105+
| ---------------------------------------- function or associated item `o` not found for this struct
106+
...
107+
LL | Outer::<1, 1>::o();
108+
| ^ function or associated item not found in `Outer<1, 1>`
109+
110+
error[E0308]: mismatched types
111+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:6:44
112+
|
113+
LL | impl<const A: usize, const B: usize> Outer<A, B>
114+
| ^ expected `i64`, found `usize`
115+
116+
error[E0308]: mismatched types
117+
--> $DIR/ice-125520-layout-mismatch-mulwithoverflow.rs:6:47
118+
|
119+
LL | impl<const A: usize, const B: usize> Outer<A, B>
120+
| ^ expected `i64`, found `usize`
121+
122+
error: aborting due to 10 previous errors; 1 warning emitted
123+
124+
Some errors have detailed explanations: E0308, E0599.
125+
For more information about an error, try `rustc --explain E0308`.

tests/ui/const-generics/issues/issue-105821.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ failure-status: 101
2-
//@ known-bug: unknown
2+
//@ known-bug: rust-lang/rust#125451
33
//@ normalize-stderr-test "note: .*\n\n" -> ""
44
//@ normalize-stderr-test "thread 'rustc' panicked.*\n.*\n" -> ""
55
//@ normalize-stderr-test "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "

0 commit comments

Comments
 (0)