Rollup merge of #143056 - fmease:mv-ace-test-out-of-gci-dir, r=BoxyUwU
Move an ACE test out of the GCI directory In https://github.com/rust-lang/rust/pull/122988, a test pertaining to `associated_const_equality` was placed into the directory meant for `generic_const_items`. Let's move it where it belongs. While at it, I took the time to further minimize the test and to add a description. You can use 1.67.1 (as reported in rust-lang/rust#108220) to verify that I didn't butcher it. For additional context, the issue was likely fixed in rust-lang/rust#112718 (but I'm also cc'ing rust-lang/rust#140467 which further fixed things up and has more context). I only performed quick and dirty git/GitHub archeology, so I don't have the full picture here. For one, I'm not even sure if this regression test is worth it. Anyway, I just want it gone from the GCI dir :)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// The impl of lint `const_evaluatable_unchecked` used to wrongly assume and `assert!` that
|
||||
// successfully evaluating a type-system constant that has non-region args had to be an anon const.
|
||||
// In the case below however we have a type-system assoc const (here: `<() as TraitA<T>>::K`).
|
||||
//
|
||||
// issue: <https://github.com/rust-lang/rust/issues/108220>
|
||||
//@ check-pass
|
||||
#![feature(associated_const_equality)]
|
||||
|
||||
pub trait TraitA<T> { const K: u8 = 0; }
|
||||
pub trait TraitB<T> {}
|
||||
|
||||
impl<T> TraitA<T> for () {}
|
||||
impl<T> TraitB<T> for () where (): TraitA<T, K = 0> {}
|
||||
|
||||
fn check<T>() where (): TraitB<T> {}
|
||||
|
||||
fn main() {}
|
||||
@@ -1,35 +0,0 @@
|
||||
// ICE assertion failed: matches!(self.def_kind(ct.def.did), DefKind :: AnonConst)
|
||||
// issue: rust-lang/rust#108220
|
||||
//@ check-pass
|
||||
|
||||
#![feature(associated_const_equality)]
|
||||
#![allow(unused)]
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub struct NoPin;
|
||||
|
||||
pub trait SetAlternate<const A: u8> {}
|
||||
|
||||
impl SetAlternate<0> for NoPin {}
|
||||
|
||||
pub trait PinA<PER> {
|
||||
const A: u8;
|
||||
}
|
||||
|
||||
impl<PER> PinA<PER> for NoPin {
|
||||
const A: u8 = 0;
|
||||
}
|
||||
|
||||
pub trait Pins<USART> {}
|
||||
|
||||
impl<USART, T, const TA: u8> Pins<USART> for T where
|
||||
T: PinA<USART, A = { TA }> + SetAlternate<TA>
|
||||
{
|
||||
}
|
||||
|
||||
struct Serial<USART>(PhantomData<USART>);
|
||||
|
||||
impl<USART> Serial<USART> where NoPin: Pins<USART> {}
|
||||
|
||||
fn main() {}
|
||||
Reference in New Issue
Block a user