Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- fn foo(strings: &(&String, &String)) -> (&str, &str) { (&strings.0, &strings.1) } // You can do this
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0106]: missing lifetime specifier
- --> src/main.rs:6:50
- |
- 6 | fn foo(strings: &(&String, &String)) -> (&str, &str) { (&strings.0, &strings.1) } // You can do this
- | ^ expected lifetime parameter
- |
- = help: this function's return type contains a borrowed value, but the signature does not say which one of `strings`'s 3 lifetimes it is borrowed from
- error[E0106]: missing lifetime specifier
- --> src/main.rs:6:56
- |
- 6 | fn foo(strings: &(&String, &String)) -> (&str, &str) { (&strings.0, &strings.1) } // You can do this
- | ^ expected lifetime parameter
- |
- = help: this function's return type contains a borrowed value, but the signature does not say which one of `strings`'s 3 lifetimes it is borrowed from
- error: aborting due to 2 previous errors
- For more information about this error, try `rustc --explain E0106`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement