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 8a87b94 commit 406049dCopy full SHA for 406049d
src/test/ui/associated-types/issue-64848.rs
@@ -0,0 +1,29 @@
1
+// build-pass
2
+
3
+trait AssociatedConstant {
4
+ const DATA: ();
5
+}
6
7
+impl<F, T> AssociatedConstant for F
8
+where
9
+ F: FnOnce() -> T,
10
+ T: AssociatedConstant,
11
+{
12
+ const DATA: () = T::DATA;
13
14
15
+impl AssociatedConstant for () {
16
+ const DATA: () = ();
17
18
19
+fn foo() -> impl AssociatedConstant {
20
+ ()
21
22
23
+fn get_data<T: AssociatedConstant>(_: T) -> &'static () {
24
+ &T::DATA
25
26
27
+fn main() {
28
+ get_data(foo);
29
0 commit comments