Add regression test
This commit is contained in:
parent
75fd074338
commit
0689a4f4f7
32
tests/ui/impl-trait/nested-hkl-lifetime.rs
Normal file
32
tests/ui/impl-trait/nested-hkl-lifetime.rs
Normal file
@ -0,0 +1,32 @@
|
||||
//@ check-pass
|
||||
|
||||
use std::iter::FromIterator;
|
||||
|
||||
struct DynamicAlt<P>(P);
|
||||
|
||||
impl<P> FromIterator<P> for DynamicAlt<P> {
|
||||
fn from_iter<T: IntoIterator<Item = P>>(_iter: T) -> Self {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
|
||||
fn owned_context<I, F>(_: F) -> impl FnMut(I) -> I {
|
||||
|i| i
|
||||
}
|
||||
|
||||
trait Parser<I> {}
|
||||
|
||||
impl<T, I> Parser<I> for T where T: FnMut(I) -> I {}
|
||||
|
||||
fn alt<I, P: Parser<I>>(_: DynamicAlt<P>) -> impl FnMut(I) -> I {
|
||||
|i| i
|
||||
}
|
||||
|
||||
fn rule_to_parser<'c>() -> impl Parser<&'c str> {
|
||||
move |input| {
|
||||
let v: Vec<()> = vec![];
|
||||
alt(v.iter().map(|()| owned_context(rule_to_parser())).collect::<DynamicAlt<_>>())(input)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user