We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae2d2d9 commit 6963320Copy full SHA for 6963320
ices/79018.sh
@@ -0,0 +1,39 @@
1
+#!/bin/bash
2
+
3
+rustc - << 'EOF'
4
+#![crate_type = "lib"]
5
+#![feature(const_generics, const_evaluatable_checked)]
6
+#![allow(incomplete_features)]
7
8
+pub struct Const<const U: u8>;
9
10
+pub trait Trait {
11
+ type AssocTy;
12
+ fn assoc_fn() -> Self::AssocTy;
13
+}
14
15
+impl<const U: u8> Trait for Const<U>
16
+where
17
+ Const<{ my_const_fn(U) }>: ,
18
+{
19
+ type AssocTy = Const<{ my_const_fn(U) }>;
20
+ fn assoc_fn() -> Self::AssocTy {
21
+ Const
22
+ }
23
24
25
+const fn my_const_fn(val: u8) -> u8 {
26
+ // body of this function doesn't matter
27
+ val
28
29
+EOF
30
31
+rustc --extern my_crate=$(ls librust_out.*) - << 'EOF'
32
+extern crate my_crate;
33
34
+use my_crate::{Const, Trait};
35
36
+fn main() {
37
+ let _ = Const::<1>::assoc_fn();
38
39
0 commit comments