rust-book-cn/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/output.txt
2021-05-09 14:49:31 +08:00

34 lines
803 B
Plaintext

$ cargo run
Compiling structs v0.1.0 (file:///projects/structs)
error[E0106]: missing lifetime specifier
--> src/main.rs:2:15
|
2 | username: &str,
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
1 | struct User<'a> {
2 | username: &'a str,
|
error[E0106]: missing lifetime specifier
--> src/main.rs:3:12
|
3 | email: &str,
| ^ expected named lifetime parameter
|
help: consider introducing a named lifetime parameter
|
1 | struct User<'a> {
2 | username: &str,
3 | email: &'a str,
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0106`.
error: could not compile `structs`
To learn more, run the command again with --verbose.