Advice to change function signature when aliases are involved
Here’s a scenario from earlier in this guide. The compiler advice is:
error[E0621]: explicit lifetime required in the type of `s`
--> src/lib.rs:5:9
|
4 | fn new(s: &str) -> Node<'_> {
| ---- help: add explicit lifetime `'a` to the type of `s`: `&'a str`
5 | Self(s)
| ^^^^^^^ lifetime `'a` required
- Self(s)
+ Node(s)
And you may get this advice when implementing a trait, where you usually can’t change the signature.