rust/tests/ui/const-generics/bad-subst-const-kind.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
292 B
Rust
Raw Normal View History

//@ incremental
#![crate_type = "lib"]
trait Q {
const ASSOC: usize;
}
impl<const N: u64> Q for [u8; N] {
//~^ ERROR mismatched types
const ASSOC: usize = 1;
}
2024-05-29 16:06:50 +00:00
pub fn test() -> [u8; <[u8; 13] as Q>::ASSOC] {
//~^ ERROR: the constant `13` is not of type `u64`
todo!()
}