Update crashes tests based on fixed or changed ICEs

This commit is contained in:
Noah Lev 2025-11-01 14:39:21 -04:00
parent 91054e8042
commit dbb33c77ab
10 changed files with 91 additions and 35 deletions

View file

@ -1,7 +1,10 @@
//@ known-bug: #119783
#![feature(associated_const_equality)]
#![feature(associated_const_equality, min_generic_const_args)]
trait Trait { const F: fn(); }
trait Trait {
#[type_const]
const F: fn();
}
fn take(_: impl Trait<F = { || {} }>) {}

View file

@ -1,15 +0,0 @@
//@ known-bug: #131046
trait Owner {
const C<const N: u32>: u32;
}
impl Owner for () {
const C<const N: u32>: u32 = N;
}
fn take0<const N: u64>(_: impl Owner<C<N> = { N }>) {}
fn main() {
take0::<128>(());
}

View file

@ -1,13 +0,0 @@
//@ known-bug: #134641
#![feature(associated_const_equality)]
pub trait IsVoid {
const IS_VOID: bool;
}
impl IsVoid for () {
const IS_VOID: bool = true;
}
pub trait Maybe {}
impl Maybe for () {}
impl Maybe for () where (): IsVoid<IS_VOID = true> {}

View file

@ -5,6 +5,7 @@
struct OnDiskDirEntry<'a> {}
impl<'a> OnDiskDirEntry<'a> {
#[type_const]
const LFN_FRAGMENT_LEN: i64 = 2;
fn lfn_contents() -> [char; Self::LFN_FRAGMENT_LEN] {

View file

@ -0,0 +1,18 @@
#![feature(associated_const_equality, min_generic_const_args)]
#![expect(incomplete_features)]
pub trait IsVoid {
#[type_const]
const IS_VOID: bool;
}
impl IsVoid for () {
#[type_const]
const IS_VOID: bool = true;
}
pub trait Maybe {}
impl Maybe for () {}
impl Maybe for () where (): IsVoid<IS_VOID = true> {}
//~^ ERROR conflicting implementations of trait `Maybe` for type `()`
fn main() {}

View file

@ -0,0 +1,11 @@
error[E0119]: conflicting implementations of trait `Maybe` for type `()`
--> $DIR/coherence.rs:15:1
|
LL | impl Maybe for () {}
| ----------------- first implementation here
LL | impl Maybe for () where (): IsVoid<IS_VOID = true> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0119`.

View file

@ -1,11 +1,11 @@
//@ known-bug: #131406
trait Owner {
const C<const N: u32>: u32 = N;
//~^ ERROR: generic const items are experimental
}
impl Owner for () {}
fn take0<const N: u64>(_: impl Owner<C<N> = { N }>) {}
//~^ ERROR: associated const equality is incomplete
fn main() {
take0::<128>(());

View file

@ -0,0 +1,23 @@
error[E0658]: associated const equality is incomplete
--> $DIR/mismatched-types-with-generic-in-ace-no-feature-gate.rs:7:38
|
LL | fn take0<const N: u64>(_: impl Owner<C<N> = { N }>) {}
| ^^^^^^^^^^^^
|
= note: see issue #92827 <https://github.com/rust-lang/rust/issues/92827> for more information
= help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: generic const items are experimental
--> $DIR/mismatched-types-with-generic-in-ace-no-feature-gate.rs:2:12
|
LL | const C<const N: u32>: u32 = N;
| ^^^^^^^^^^^^^^
|
= note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
= help: add `#![feature(generic_const_items)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,18 +1,20 @@
//@ known-bug: #127643
#![feature(generic_const_items, associated_const_equality)]
#![feature(generic_const_items, associated_const_equality, min_generic_const_args)]
#![expect(incomplete_features)]
trait Foo {
#[type_const]
const ASSOC<const N: u32>: u32;
}
impl Foo for () {
#[type_const]
const ASSOC<const N: u32>: u32 = N;
}
fn bar<const N: u64, T: Foo<ASSOC<N> = { N }>>() {}
//~^ ERROR: the constant `N` is not of type `u32`
fn main() {
bar::<10_u64, ()>();
//~^ ERROR: the constant `10` is not of type `u32`
}

View file

@ -0,0 +1,26 @@
error: the constant `N` is not of type `u32`
--> $DIR/mismatched-types-with-generic-in-ace.rs:14:29
|
LL | fn bar<const N: u64, T: Foo<ASSOC<N> = { N }>>() {}
| ^^^^^^^^^^^^^^^^ expected `u32`, found `u64`
|
note: required by a const generic parameter in `Foo::ASSOC`
--> $DIR/mismatched-types-with-generic-in-ace.rs:6:17
|
LL | const ASSOC<const N: u32>: u32;
| ^^^^^^^^^^^^ required by this const generic parameter in `Foo::ASSOC`
error: the constant `10` is not of type `u32`
--> $DIR/mismatched-types-with-generic-in-ace.rs:18:5
|
LL | bar::<10_u64, ()>();
| ^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`
|
note: required by a const generic parameter in `Foo::ASSOC`
--> $DIR/mismatched-types-with-generic-in-ace.rs:6:17
|
LL | const ASSOC<const N: u32>: u32;
| ^^^^^^^^^^^^ required by this const generic parameter in `Foo::ASSOC`
error: aborting due to 2 previous errors