]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/concrete-const-impl-method.rs
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.git] / tests / 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 pub struct A<const N: u32>;
6
7 impl A<2> {
8     fn impl_method(&self) -> u32 {
9         17
10     }
11
12     fn associated_non_method() -> u32 {
13         17
14     }
15 }
16
17 fn main() {
18     let val: A<2> = A;
19     assert_eq!(val.impl_method(), 17);
20     assert_eq!(A::<2>::associated_non_method(), 17);
21 }