[yaseenist] Julia :verified_trans: on Nostr: error[E0308]: mismatched types --> mfm-rs/src/expanded.rs:68:9 | 68 | / ...
error[E0308]: mismatched types
--> mfm-rs/src/expanded.rs:68:9
|
68 | / parser::map(sequence, |children| {
69 | | let children = children
70 | | .into_iter()
71 | | .map(|either| {
... |
77 | | BlockNode::Center { children }
78 | | })
| |__________^ one type is more general than the other
|
= note: expected trait `for<'a, 'b> <[closure@mfm-rs/src/expanded.rs:53:13: 55:84] as FnOnce<(CharIndices<'a>, &'b mut ParserState)>>`
found trait `for<'a, 'b> <[closure@mfm-rs/src/expanded.rs:53:13: 55:84] as FnOnce<(CharIndices<'a>, &'b mut ParserState)>>`
note: this closure does not fulfill the lifetime requirements
--> mfm-rs/src/expanded.rs:53:13
|
53 | / for<'a, 'b> move |chars: CharIndices<'a>,
54 | | state: &'b mut ParserState|
55 | | -> Result<'a, (Vec<Either<InlineNode<'a>, &'a str>>)> {
| |___________________________________________________________________________________^
note: the lifetime requirement is introduced here
--> mfm-rs/src/parser.rs:311:40
|
311 | pub const fn map<F, T, U>(parser: impl for<'a> Parser<Output<'a> = T>, mapper: F) -> impl for<'a> Parser<Output<'a> = U>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think because T isn't generic over 'a, its making it such that the expectation is that T lives forever?
Published at
2023-06-13 01:53:06Event JSON
{
"id": "265e7228d23cc1e6922705f733bb2014328a83a31206163c5b34c86b545e63ff",
"pubkey": "bdf8e6a9c859b03b22181316d0f52e886a65f134ab5502c7d7ee2659a988409a",
"created_at": 1686621186,
"kind": 1,
"tags": [
[
"e",
"f1694d16f246dbf0e632b51a92d6576c1a91f31b5d6a99416024a0d5fb3bc48c",
"wss://relay.mostr.pub",
"reply"
],
[
"mostr",
"https://snug.moe/notes/9fx70q1zrr"
]
],
"content": "\n\nerror[E0308]: mismatched types\n --\u003e mfm-rs/src/expanded.rs:68:9\n |\n68 | / parser::map(sequence, |children| {\n69 | | let children = children\n70 | | .into_iter()\n71 | | .map(|either| {\n... |\n77 | | BlockNode::Center { children }\n78 | | })\n | |__________^ one type is more general than the other\n |\n = note: expected trait `for\u003c'a, 'b\u003e \u003c[closure@mfm-rs/src/expanded.rs:53:13: 55:84] as FnOnce\u003c(CharIndices\u003c'a\u003e, \u0026'b mut ParserState)\u003e\u003e`\n found trait `for\u003c'a, 'b\u003e \u003c[closure@mfm-rs/src/expanded.rs:53:13: 55:84] as FnOnce\u003c(CharIndices\u003c'a\u003e, \u0026'b mut ParserState)\u003e\u003e`\nnote: this closure does not fulfill the lifetime requirements\n --\u003e mfm-rs/src/expanded.rs:53:13\n |\n53 | / for\u003c'a, 'b\u003e move |chars: CharIndices\u003c'a\u003e,\n54 | | state: \u0026'b mut ParserState|\n55 | | -\u003e Result\u003c'a, (Vec\u003cEither\u003cInlineNode\u003c'a\u003e, \u0026'a str\u003e\u003e)\u003e {\n | |___________________________________________________________________________________^\nnote: the lifetime requirement is introduced here\n --\u003e mfm-rs/src/parser.rs:311:40\n |\n311 | pub const fn map\u003cF, T, U\u003e(parser: impl for\u003c'a\u003e Parser\u003cOutput\u003c'a\u003e = T\u003e, mapper: F) -\u003e impl for\u003c'a\u003e Parser\u003cOutput\u003c'a\u003e = U\u003e\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nI think because T isn't generic over 'a, its making it such that the expectation is that T lives forever?",
"sig": "45e66563e6bab3e236b10440b72ff07600bc7a9843b4a49ffd06a944a51569bcc76dfbc52830aa1cc2f7f6504bc06ff7ca8907d6726e127da5d206ed4b1d5067"
}