Skip to content

Commit

Permalink
Add 81403
Browse files Browse the repository at this point in the history
  • Loading branch information
fanninpm committed Jan 29, 2021
1 parent 7872b31 commit 787a0cc
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions ices/81403.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

rustc --emit=mir -Zmir-opt-level=2 - <<'EOF'
// build-pass
pub trait Foo<'a> {
type Bar;
fn foo(&'a self) -> Self::Bar;
}
impl<'a, 'b, T: 'a> Foo<'a> for &'b T {
type Bar = &'a T;
fn foo(&'a self) -> &'a T {
self
}
}
pub fn uncallable<T, F>(x: T, f: F)
where T: for<'a> Foo<'a>,
F: for<'a> Fn(<T as Foo<'a>>::Bar)
{
f(x.foo());
}
pub fn broken<F: Fn(&i32)>(x: &i32, f: F) {
uncallable(x, |y| f(y));
}
fn main() { }
EOF

0 comments on commit 787a0cc

Please sign in to comment.