You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::io::{Read,Seek};typeError = String;typeParserResult<Output> = Result<Output,Error>;typeParser<'a,Output> = Box<dynFn(&mutdynReadSeeker) -> ParserResult<Output>>;traitReadSeeker:Read + Seek{}impl<T:Read + Seek>ReadSeekerforT{}fnbetween<Val,Discard>(wrap:Parser<'static,Val>,with:Parser<'static,Discard>) -> Parser<'static,Val>{Box::from(
|input| -> ParserResult<Val>{ifletErr(err) = with(input){returnErr(err);}let result = wrap(input);ifletErr(err) = result {returnErr(err);}ifletErr(err) = with(input){returnErr(err);}Ok(result.unwrap())})}
results in the error
error[E0308]: mismatched types
-->
|
61 | / Box::from(
62 | | |input| -> ParserResult<Val> {
63 | | if let Err(err) = with(input) {
64 | | return Err(err);
... |
74 | | }
75 | | )
| |_____^ one type is more general than the other
|
= note: expected type `std::ops::FnOnce<(&mut dyn ReadSeeker,)>`
found type `std::ops::FnOnce<(&mut dyn ReadSeeker,)>`
which doesn't do anything to explain to the user what's going on here, since the outputted types are identical.
Minimal(ish) reproducible example:
results in the error
which doesn't do anything to explain to the user what's going on here, since the outputted types are identical.
(Playground)
The text was updated successfully, but these errors were encountered: