|
87 | let t: BetweenChar<'a, 'a, P> = self.env.parens::<'a>(parser);
| ^^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 82:5...
|
82 | / pub fn parens<P>(&self, parser: P) -> impl Parser<Input = combine::stream::easy::Stream<&'a str>, Output = P::Output>
83 | | where
84 | | P: Parser<Input = combine::stream::easy::Stream<&'a str>>,
85 | | // P::Input : Stream<Item = char>,
... |
88 | | t
89 | | }
| |_____^
note: ...so that reference does not outlive borrowed content
87 | let t: BetweenChar<'a, 'a, P> = self.env.parens::<'a>(parser);
| ^^^^^^^^
note: but, the lifetime must be valid for the lifetime 'a as defined on the impl at 80:7...
|
80 | impl <'a> FooParser<'a> {
| ^^
= note: ...so that the types are compatible:
expected &'a combine_language::LanguageEnv<'_, combine::stream::easy::Stream<&'a str>>
found &combine_language::LanguageEnv<'a, combine::stream::easy::Stream<&'a str>>
I have tried almost every option of 'a, 'b. Any idea wtf is going on and how to fix it?
Definitely seems complicated. Just replying without knowledge of LanguageEnv or its parens function. Some small snippet that can be run (same error) on play goes a long way being able to help.
@jonh : I can create a minimal failure case. Is there a way to add a Cargo.toml dependencies to the Rust playground? I couldn't figure out how to do that.
Nevertheless, is there a way to attach Cargo.toml dependencies to Rust playground? I am happy to create minimal failure cases, I just can't figure out how to add dependencies.
The Playground's Source includes a Cargo.toml which is meant to be the base for playground projects. I'm not too sure, but according to this, there seems to be the first 218 top used crates. You might want to confirm that with @shepmaster though.
The playground provides the top 100 most downloaded crates from crates.io, the crates from the Rust Cookbook, and all of their dependencies
However, the playground is still a great way to share your MCVE, even if it cannot be run on the playground. We track a list of steps to create a MCVE over on Stack Overflow (see "Producing a Minimal, Complete, Verifiable example for Rust code") which can be useful to reduce your local code to something that could work in the playground.