]> git.lizzy.rs Git - rust.git/blob - src/test/ui/symbol-names/const-generics.rs
Rollup merge of #80398 - CAD97:fix-80365, r=dtolnay
[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 // `char`
7 pub struct Char<const F: char>;
8
9 impl Char<'A'> {
10     pub fn foo() {}
11 }
12
13 impl<const F: char> Char<F> {
14     pub fn bar() {}
15 }
16
17 // `i8`
18 pub struct I8<const F: i8>;
19
20 impl I8<{i8::MIN}> {
21     pub fn foo() {}
22 }
23
24 impl I8<{i8::MAX}> {
25     pub fn foo() {}
26 }
27
28 impl<const F: i8> I8<F> {
29     pub fn bar() {}
30 }
31
32 // `i16`
33 pub struct I16<const F: i16>;
34
35 impl I16<{i16::MIN}> {
36     pub fn foo() {}
37 }
38
39 impl<const F: i16> I16<F> {
40     pub fn bar() {}
41 }
42
43 // `i32`
44 pub struct I32<const F: i32>;
45
46 impl I32<{i32::MIN}> {
47     pub fn foo() {}
48 }
49
50 impl<const F: i32> I32<F> {
51     pub fn bar() {}
52 }
53
54 // `i64`
55 pub struct I64<const F: i64>;
56
57 impl I64<{i64::MIN}> {
58     pub fn foo() {}
59 }
60
61 impl<const F: i64> I64<F> {
62     pub fn bar() {}
63 }
64
65 // `i128`
66 pub struct I128<const F: i128>;
67
68 impl I128<{i128::MIN}> {
69     pub fn foo() {}
70 }
71
72 impl<const F: i128> I128<F> {
73     pub fn bar() {}
74 }
75
76 // `isize`
77 pub struct ISize<const F: isize>;
78
79 impl ISize<3> {
80     pub fn foo() {}
81 }
82
83 impl<const F: isize> ISize<F> {
84     pub fn bar() {}
85 }