add tests

This commit is contained in:
lcnr 2024-11-29 18:43:55 +01:00
parent d5a0c5cfdb
commit f0ae48d106
8 changed files with 45 additions and 33 deletions

View File

@ -1,33 +0,0 @@
//@ known-bug: #133639
#![feature(with_negative_coherence)]
#![feature(min_specialization)]
#![feature(generic_const_exprs)]
#![crate_type = "lib"]
use std::str::FromStr;
struct a<const b: bool>;
trait c {}
impl<const d: u32> FromStr for e<d>
where
a<{ d <= 2 }>: c,
{
type Err = ();
fn from_str(f: &str) -> Result<Self, Self::Err> {
unimplemented!()
}
}
struct e<const d: u32>;
impl<const d: u32> FromStr for e<d>
where
a<{ d <= 2 }>: c,
{
type Err = ();
fn from_str(f: &str) -> Result<Self, Self::Err> {
unimplemented!()
}
}

View File

@ -0,0 +1,19 @@
//@ check-pass
// Regression test for #133639.
#![feature(with_negative_coherence)]
#![feature(min_specialization)]
#![feature(generic_const_exprs)]
//~^ WARNING the feature `generic_const_exprs` is incomplete
#![crate_type = "lib"]
trait Trait {}
struct A<const B: bool>;
trait C {}
impl<const D: u32> Trait for E<D> where A<{ D <= 2 }>: C {}
struct E<const D: u32>;
impl<const D: u32> Trait for E<D> where A<{ D <= 2 }>: C {}

View File

@ -0,0 +1,11 @@
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/specialization-fuzzing-ice-133639.rs:7:12
|
LL | #![feature(generic_const_exprs)]
| ^^^^^^^^^^^^^^^^^^^
|
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted

View File

@ -1,3 +1,6 @@
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ check-pass
// This caused a regression in a crater run in #132325.

View File

@ -1,3 +1,6 @@
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ check-pass
// A regression test for an edge case of candidate selection

View File

@ -1,3 +1,6 @@
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ check-pass
// A regression test for an edge case of candidate selection

View File

@ -1,3 +1,6 @@
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ check-pass
// A regression test for an edge case of candidate selection

View File

@ -1,3 +1,6 @@
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ check-pass
// A regression test for an edge case of candidate selection