summaryrefslogtreecommitdiffstats
path: root/src/doc/book/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/output.txt
blob: 534a984a6333d90a9a84c578df49e44934d5212d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ cargo run
   Compiling chapter10 v0.1.0 (file:///projects/chapter10)
error[E0106]: missing lifetime specifier
 --> src/main.rs:9:33
  |
9 | fn longest(x: &str, y: &str) -> &str {
  |               ----     ----     ^ expected named lifetime parameter
  |
  = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y`
help: consider introducing a named lifetime parameter
  |
9 | fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
  |           ++++     ++          ++          ++

For more information about this error, try `rustc --explain E0106`.
error: could not compile `chapter10` due to previous error