Hi, (warning: not a Rust expert) there was a small thing that confused me while reading:
In one of the examples in the 'static lifetime elision section of the lifetime-elision chapter, I got the following error messages when trying out the explicit (non-elided) form.
From the error messages, I conclude, that fn<'a>(&'a str) -> &'a str and Fn<'a, 'b, 'c>(&'a Foo, &'b Bar, &'c Baz) -> usize are not valid syntax for function pointers or closure traits and higher-ranked trait bound must be used instead.
I fixed the comments in the example according to the error message and verified that it compiles.
Hi, (warning: not a Rust expert) there was a small thing that confused me while reading:
In one of the examples in the
'static lifetime elision
section of thelifetime-elision
chapter, I got the following error messages when trying out the explicit (non-elided) form.Example:
First case (function pointer):
Second case (closure trait):
From the error messages, I conclude, that
fn<'a>(&'a str) -> &'a str
andFn<'a, 'b, 'c>(&'a Foo, &'b Bar, &'c Baz) -> usize
are not valid syntax for function pointers or closure traits and higher-ranked trait bound must be used instead.I fixed the comments in the example according to the error message and verified that it compiles.