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 7872b31 commit 787a0ccCopy full SHA for 787a0cc
ices/81403.sh
@@ -0,0 +1,29 @@
1
+#!/bin/bash
2
+
3
+rustc --emit=mir -Zmir-opt-level=2 - <<'EOF'
4
+// build-pass
5
+pub trait Foo<'a> {
6
+ type Bar;
7
+ fn foo(&'a self) -> Self::Bar;
8
+}
9
10
+impl<'a, 'b, T: 'a> Foo<'a> for &'b T {
11
+ type Bar = &'a T;
12
+ fn foo(&'a self) -> &'a T {
13
+ self
14
+ }
15
16
17
+pub fn uncallable<T, F>(x: T, f: F)
18
+ where T: for<'a> Foo<'a>,
19
+ F: for<'a> Fn(<T as Foo<'a>>::Bar)
20
+{
21
+ f(x.foo());
22
23
24
+pub fn broken<F: Fn(&i32)>(x: &i32, f: F) {
25
+ uncallable(x, |y| f(y));
26
27
28
+fn main() { }
29
+EOF
0 commit comments