mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-03 07:48:41 +08:00
34 lines
803 B
Plaintext
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.
|