// build-fail // normalize-stderr-test: ".nll/" -> "/" trait ToOpt: Sized { fn to_option(&self) -> Option; } impl ToOpt for usize { fn to_option(&self) -> Option { Some(*self) } } impl ToOpt for Option { fn to_option(&self) -> Option> { Some((*self).clone()) } } fn function(counter: usize, t: T) { if counter > 0 { function(counter - 1, t.to_option()); //~^ ERROR reached the recursion limit while instantiating `function::