Open
Description
Example: http://is.gd/8dVXWc
<anon>:42:14: 42:33 error: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
<anon>:42 Some(&mut self.cont.item)
^~~~~~~~~~~~~~~~~~~
<anon>:39:5: 43:6 help: consider using an explicit lifetime parameter as shown: fn next(&'a mut self) -> Option<&'a mut V>
<anon>:39 fn next(&mut self) -> Option<&'a mut V> {
<anon>:40 if self.emitted { return None }
<anon>:41 self.emitted = true;
<anon>:42 Some(&mut self.cont.item)
<anon>:43 }
error: aborting due to previous error
playpen: application terminated with error code 101
Compilation failed.
@bluss gave me a helpful link on IRC, stating that is a classic thing.
I think for every "classic" problem there should be a lint giving a link to some article about the problem.
In this case the link can be emitted for any lifetimes problem when mutable references and Iterator
trait involved together.
For reference: link to changed version that does compile.