Closed
Description
I didn't see any obvious duplicates, but the following ICEs on playpen.
https://play.rust-lang.org/?gist=5bf75eadd36cf418734c&version=stable
trait Test<'a> {
type Inner:'a;
}
impl<'a> Test<'a> for &'a String {
type Inner = &'a String;
}
fn test<L>(func: L) where L : for<'b> Fn(&'b <&'b String as Test<'b>>::Inner) { }
fn main() {
test(|x| println!("{:?}", x));
}
As an aside, this showed up because I was really hoping the below would work, but it doesn't seem to (for reasons I don't understand). Opinions on this are welcome too; the code above isn't particularly well motivated (I didn't actually want to write it; Syntaf on irc observed the ICE).
trait Test<'a> {
type Inner:'a;
}
impl<'a> Test<'a> for &'a String {
type Inner = &'a String;
}
fn test<L>(func: L) where L : for<'b,'a:'b> Fn(&'b <&'a String as Test<'a>>::Inner) { }
fn main() {
test(|x| println!("{:?}", x));
}
Metadata
Metadata
Assignees
Labels
No labels