]> git.lizzy.rs Git - rust.git/blob - src/test/ui/symbol-names/const-generics.rs
Update tests to remove old numeric constants
[rust.git] / src / test / ui / symbol-names / const-generics.rs
1 // check-pass
2 // revisions: legacy v0
3 //[legacy]compile-flags: -Z symbol-mangling-version=legacy --crate-type=lib
4     //[v0]compile-flags: -Z symbol-mangling-version=v0 --crate-type=lib
5
6     #![feature(min_const_generics)]
7
8     // `char`
9     pub struct Char<const F: char>;
10
11     impl Char<'A'> {
12         pub fn foo() {}
13     }
14
15     impl<const F: char> Char<F> {
16         pub fn bar() {}
17     }
18
19     // `i8`
20     pub struct I8<const F: i8>;
21
22     impl I8<{i8::MIN}> {
23         pub fn foo() {}
24     }
25
26     impl I8<{i8::MAX}> {
27         pub fn foo() {}
28     }
29
30     impl<const F: i8> I8<F> {
31         pub fn bar() {}
32     }
33
34     // `i16`
35     pub struct I16<const F: i16>;
36
37     impl I16<{i16::MIN}> {
38         pub fn foo() {}
39     }
40
41     impl<const F: i16> I16<F> {
42         pub fn bar() {}
43     }
44
45     // `i32`
46     pub struct I32<const F: i32>;
47
48     impl I32<{i32::MIN}> {
49         pub fn foo() {}
50     }
51
52     impl<const F: i32> I32<F> {
53         pub fn bar() {}
54     }
55
56     // `i64`
57     pub struct I64<const F: i64>;
58
59     impl I64<{i64::MIN}> {
60         pub fn foo() {}
61     }
62
63     impl<const F: i64> I64<F> {
64         pub fn bar() {}
65     }
66
67     // `i128`
68     pub struct I128<const F: i128>;
69
70     impl I128<{i128::MIN}> {
71         pub fn foo() {}
72     }
73
74     impl<const F: i128> I128<F> {
75         pub fn bar() {}
76     }
77
78     // `isize`
79     pub struct ISize<const F: isize>;
80
81     impl ISize<3> {
82         pub fn foo() {}
83     }
84
85     impl<const F: isize> ISize<F> {
86         pub fn bar() {}
87     }