]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/concrete-const-impl-method.rs
Merge commit '0cce3f643bfcbb92d5a1bb71858c9cbaff749d6b' into clippyup
[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 // revisions: full min
5
6 #![cfg_attr(full, feature(const_generics))]
7 #![cfg_attr(full, allow(incomplete_features))]
8
9 pub struct A<const N: u32>;
10
11 impl A<2> {
12     fn impl_method(&self) -> u32 {
13         17
14     }
15
16     fn associated_non_method() -> u32 {
17         17
18     }
19 }
20
21 fn main() {
22     let val: A<2> = A;
23     assert_eq!(val.impl_method(), 17);
24     assert_eq!(A::<2>::associated_non_method(), 17);
25 }