]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/projection-as-arg-const.rs
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.git] / tests / ui / const-generics / projection-as-arg-const.rs
1 // This is currently not possible to use projections as const generics.
2 // More information about this available here:
3 // https://github.com/rust-lang/rust/pull/104443#discussion_r1029375633
4
5 pub trait Identity {
6     type Identity;
7 }
8
9 impl<T> Identity for T {
10     type Identity = Self;
11 }
12
13 pub fn foo<const X: <i32 as Identity>::Identity>() {
14 //~^ ERROR
15     assert!(X == 12);
16 }
17
18 fn main() {
19     foo::<12>();
20 }