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.
2 parents 4083c69 + b129de4 commit c789291Copy full SHA for c789291
src/test/run-pass/issues/issue-58435-ice-with-assoc-const.rs
@@ -0,0 +1,17 @@
1
+// The const-evaluator was at one point ICE'ing while trying to
2
+// evaluate the body of `fn id` during the `s.id()` call in main.
3
+
4
+struct S<T>(T);
5
6
+impl<T> S<T> {
7
+ const ID: fn(&S<T>) -> &S<T> = |s| s;
8
+ pub fn id(&self) -> &Self {
9
+ Self::ID(self) // This, plus call below ...
10
+ }
11
+}
12
13
+fn main() {
14
+ let s = S(10u32);
15
+ assert!(S::<u32>::ID(&s).0 == 10); // Works fine
16
+ assert!(s.id().0 == 10); // ... causes compiler to panic
17
0 commit comments