]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/concrete-const-impl-method.rs
Rollup merge of #75262 - pickfire:patch-6, r=jyn514
[rust.git] / src / test / ui / const-generics / concrete-const-impl-method.rs
1 // Test that a method/associated non-method within an impl block of a concrete const type i.e. A<2>,
2 // is callable.
3 // run-pass
4
5 #![feature(const_generics)]
6 //~^ WARN the feature `const_generics` is incomplete
7
8 pub struct A<const N: u32>;
9
10 impl A<2> {
11     fn impl_method(&self) -> u32 {
12         17
13     }
14
15     fn associated_non_method() -> u32 {
16         17
17     }
18 }
19
20 fn main() {
21     let val: A<2> = A;
22     assert_eq!(val.impl_method(), 17);
23     assert_eq!(A::<2>::associated_non_method(), 17);
24 }