rust/tests/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs

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

13 lines
196 B
Rust
Raw Normal View History

2019-10-07 21:01:58 +00:00
//@ run-pass
pub trait BitLen: Sized {
const BIT_LEN: usize;
}
impl<const L: usize> BitLen for [u8; L] {
const BIT_LEN: usize = 8 * L;
}
fn main() {
2020-09-10 07:04:14 +00:00
let _foo = <[u8; 2]>::BIT_LEN;
2019-10-07 21:01:58 +00:00
}