Skip to content

only declared function parsers can be used #3

@Geal

Description

@Geal

Apparently I cannot write this:

let _ = i.parse( tag("abcd").map(|_| ()) )?;

As it would result in this error:

error[E0308]: mismatched types
  --> examples/sync_http.rs:35:15
   |
35 |     let _ = i.parse(tag("abcd").map(|_| ()))?;
   |               ^^^^^ one type is more general than the other
   | 
  ::: /home/geal/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-6.2.1/src/bytes/streaming.rs:34:6
   |
34 | ) -> impl Fn(Input) -> IResult<Input, Input, Error>
   |      ----------------------------------------------
   |      |
   |      the expected opaque type
   |      the found opaque type
   |
   = note: expected associated type `<impl Fn<(&[u8],)> as FnOnce<(&[u8],)>>::Output`
              found associated type `<impl Fn<(&[u8],)> as FnOnce<(&'a [u8],)>>::Output`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `nom-bufreader` due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions