Skip to content

Commit 0530333

Browse files
committed
Update crashes tests based on fixed or changed ICEs
1 parent eee8a0f commit 0530333

10 files changed

+91
-35
lines changed

tests/crashes/119783.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
//@ known-bug: #119783
2-
#![feature(associated_const_equality)]
2+
#![feature(associated_const_equality, min_generic_const_args)]
33

4-
trait Trait { const F: fn(); }
4+
trait Trait {
5+
#[type_const]
6+
const F: fn();
7+
}
58

69
fn take(_: impl Trait<F = { || {} }>) {}
710

tests/crashes/131046.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/crashes/134641.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/crashes/138089.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
struct OnDiskDirEntry<'a> {}
66

77
impl<'a> OnDiskDirEntry<'a> {
8+
#[type_const]
89
const LFN_FRAGMENT_LEN: i64 = 2;
910

1011
fn lfn_contents() -> [char; Self::LFN_FRAGMENT_LEN] {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![feature(associated_const_equality, min_generic_const_args)]
2+
#![expect(incomplete_features)]
3+
4+
pub trait IsVoid {
5+
#[type_const]
6+
const IS_VOID: bool;
7+
}
8+
impl IsVoid for () {
9+
#[type_const]
10+
const IS_VOID: bool = true;
11+
}
12+
13+
pub trait Maybe {}
14+
impl Maybe for () {}
15+
impl Maybe for () where (): IsVoid<IS_VOID = true> {}
16+
//~^ ERROR conflicting implementations of trait `Maybe` for type `()`
17+
18+
fn main() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0119]: conflicting implementations of trait `Maybe` for type `()`
2+
--> $DIR/coherence.rs:15:1
3+
|
4+
LL | impl Maybe for () {}
5+
| ----------------- first implementation here
6+
LL | impl Maybe for () where (): IsVoid<IS_VOID = true> {}
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0119`.

tests/crashes/131406.rs renamed to tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace-no-feature-gate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//@ known-bug: #131406
2-
31
trait Owner {
42
const C<const N: u32>: u32 = N;
3+
//~^ ERROR: generic const items are experimental
54
}
65

76
impl Owner for () {}
87
fn take0<const N: u64>(_: impl Owner<C<N> = { N }>) {}
8+
//~^ ERROR: associated const equality is incomplete
99

1010
fn main() {
1111
take0::<128>(());
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error[E0658]: associated const equality is incomplete
2+
--> $DIR/mismatched-types-with-generic-in-ace-no-feature-gate.rs:7:38
3+
|
4+
LL | fn take0<const N: u64>(_: impl Owner<C<N> = { N }>) {}
5+
| ^^^^^^^^^^^^
6+
|
7+
= note: see issue #92827 <https://github.com/rust-lang/rust/issues/92827> for more information
8+
= help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+
error[E0658]: generic const items are experimental
12+
--> $DIR/mismatched-types-with-generic-in-ace-no-feature-gate.rs:2:12
13+
|
14+
LL | const C<const N: u32>: u32 = N;
15+
| ^^^^^^^^^^^^^^
16+
|
17+
= note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
18+
= help: add `#![feature(generic_const_items)]` to the crate attributes to enable
19+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
20+
21+
error: aborting due to 2 previous errors
22+
23+
For more information about this error, try `rustc --explain E0658`.
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
//@ known-bug: #127643
2-
3-
#![feature(generic_const_items, associated_const_equality)]
1+
#![feature(generic_const_items, associated_const_equality, min_generic_const_args)]
42
#![expect(incomplete_features)]
53

64
trait Foo {
5+
#[type_const]
76
const ASSOC<const N: u32>: u32;
87
}
98

109
impl Foo for () {
10+
#[type_const]
1111
const ASSOC<const N: u32>: u32 = N;
1212
}
1313

1414
fn bar<const N: u64, T: Foo<ASSOC<N> = { N }>>() {}
15+
//~^ ERROR: the constant `N` is not of type `u32`
1516

1617
fn main() {
1718
bar::<10_u64, ()>();
19+
//~^ ERROR: the constant `10` is not of type `u32`
1820
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
error: the constant `N` is not of type `u32`
2+
--> $DIR/mismatched-types-with-generic-in-ace.rs:14:29
3+
|
4+
LL | fn bar<const N: u64, T: Foo<ASSOC<N> = { N }>>() {}
5+
| ^^^^^^^^^^^^^^^^ expected `u32`, found `u64`
6+
|
7+
note: required by a const generic parameter in `Foo::ASSOC`
8+
--> $DIR/mismatched-types-with-generic-in-ace.rs:6:17
9+
|
10+
LL | const ASSOC<const N: u32>: u32;
11+
| ^^^^^^^^^^^^ required by this const generic parameter in `Foo::ASSOC`
12+
13+
error: the constant `10` is not of type `u32`
14+
--> $DIR/mismatched-types-with-generic-in-ace.rs:18:5
15+
|
16+
LL | bar::<10_u64, ()>();
17+
| ^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`
18+
|
19+
note: required by a const generic parameter in `Foo::ASSOC`
20+
--> $DIR/mismatched-types-with-generic-in-ace.rs:6:17
21+
|
22+
LL | const ASSOC<const N: u32>: u32;
23+
| ^^^^^^^^^^^^ required by this const generic parameter in `Foo::ASSOC`
24+
25+
error: aborting due to 2 previous errors
26+

0 commit comments

Comments
 (0)