8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fd16ba commit c08a871Copy full SHA for c08a871
src/test/ui/consts/issue-65348.rs
@@ -0,0 +1,23 @@
1
+// check-pass
2
+
3
+struct Generic<T>(T);
4
5
+impl<T> Generic<T> {
6
+ const ARRAY: [T; 0] = [];
7
+ const NEWTYPE_ARRAY: Generic<[T; 0]> = Generic([]);
8
+ const ARRAY_FIELD: Generic<(i32, [T; 0])> = Generic((0, []));
9
+}
10
11
+pub const fn array<T>() -> &'static T {
12
+ &Generic::<T>::ARRAY[0]
13
14
15
+pub const fn newtype_array<T>() -> &'static T {
16
+ &Generic::<T>::NEWTYPE_ARRAY.0[0]
17
18
19
+pub const fn array_field<T>() -> &'static T {
20
+ &(Generic::<T>::ARRAY_FIELD.0).1[0]
21
22< 3A2C /code>
23
+fn main() {}
0 commit comments