Skip to content

Commit 894386a

Browse files
committed
remove fixed crashes, add fixed crashes to tests, add new cashed found in the meantime
1 parent e5d1003 commit 894386a

8 files changed

+182
-50
lines changed

tests/crashes/125370.rs

-16
This file was deleted.

tests/crashes/125432.rs

-17
This file was deleted.

tests/crashes/125520.rs

-16
This file was deleted.

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)