// Regression test for issue #83190, triggering an ICE in borrowck. // check-pass pub trait Any {} impl Any for T {} pub trait StreamOnce { type Range; } pub trait Parser: Sized { type Output; type PartialState; fn map(self) -> Map { todo!() } } pub struct Map

(P); impl> Parser for Map

{ type Output = (); type PartialState = P::PartialState; } struct TakeWhile1(Input); impl Parser for TakeWhile1 { type Output = I::Range; type PartialState = (); } impl TakeWhile1 { fn new() -> Self { todo!() } } impl> Parser for (A,) { type Output = (); type PartialState = Map; } pub fn metric_stream_parser<'a, I>() -> impl Parser where I: StreamOnce, { (TakeWhile1::new(),).map() } fn main() {}