mirror of https://github.com/rust-lang-ru/book.git
73 changed files with 106 additions and 360 deletions
@ -1,33 +1,31 @@
@@ -1,33 +1,31 @@
|
||||
$ cargo run |
||||
Compiling structs v0.1.0 (file:///projects/structs) |
||||
error[E0106]: missing lifetime specifier |
||||
--> src/main.rs:2:15 |
||||
--> src/main.rs:3:15 |
||||
| |
||||
2 | username: &str, |
||||
3 | username: &str, |
||||
| ^ expected named lifetime parameter |
||||
| |
||||
help: consider introducing a named lifetime parameter |
||||
| |
||||
1 | struct User<'a> { |
||||
2 | username: &'a str, |
||||
2 | active: bool, |
||||
3 | username: &'a str, |
||||
| |
||||
|
||||
error[E0106]: missing lifetime specifier |
||||
--> src/main.rs:3:12 |
||||
--> src/main.rs:4:12 |
||||
| |
||||
3 | email: &str, |
||||
4 | email: &str, |
||||
| ^ expected named lifetime parameter |
||||
| |
||||
help: consider introducing a named lifetime parameter |
||||
| |
||||
1 | struct User<'a> { |
||||
2 | username: &str, |
||||
3 | email: &'a str, |
||||
2 | active: bool, |
||||
3 | username: &str, |
||||
4 | 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. |
||||
error: could not compile `structs` due to 2 previous errors |
||||
|
||||
@ -1,20 +1,16 @@
@@ -1,20 +1,16 @@
|
||||
$ cargo run |
||||
Compiling error-handling v0.1.0 (file:///projects/error-handling) |
||||
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) |
||||
--> src/main.rs:4:36 |
||||
| |
||||
3 | / fn main() { |
||||
4 | | let f = File::open("hello.txt")?; |
||||
| | ^ cannot use the `?` operator in a function that returns `()` |
||||
5 | | } |
||||
| |_- this function should return `Result` or `Option` to accept `?` |
||||
| |
||||
= help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()` |
||||
= note: required by `from_residual` |
||||
|
||||
error: aborting due to previous error |
||||
--> src/main.rs:4:36 |
||||
| |
||||
3 | / fn main() { |
||||
4 | | let f = File::open("hello.txt")?; |
||||
| | ^ cannot use the `?` operator in a function that returns `()` |
||||
5 | | } |
||||
| |_- this function should return `Result` or `Option` to accept `?` |
||||
| |
||||
= help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()` |
||||
note: required by `from_residual` |
||||
|
||||
For more information about this error, try `rustc --explain E0277`. |
||||
error: could not compile `error-handling` |
||||
|
||||
To learn more, run the command again with --verbose. |
||||
error: could not compile `error-handling` due to previous error |
||||
|
||||
@ -1,17 +1,13 @@
@@ -1,17 +1,13 @@
|
||||
$ cargo build |
||||
Compiling gui v0.1.0 (file:///projects/gui) |
||||
error[E0038]: the trait `Clone` cannot be made into an object |
||||
--> src/lib.rs:2:21 |
||||
--> src/lib.rs:2:29 |
||||
| |
||||
2 | pub components: Vec<Box<dyn Clone>>, |
||||
| ^^^^^^^^^^^^^^^^^^^ `Clone` cannot be made into an object |
||||
| ^^^^^^^^^ `Clone` cannot be made into an object |
||||
| |
||||
= note: the trait cannot be made into an object because it requires `Self: Sized` |
||||
= note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> |
||||
|
||||
error: aborting due to previous error |
||||
|
||||
For more information about this error, try `rustc --explain E0038`. |
||||
error: could not compile `gui` |
||||
|
||||
To learn more, run the command again with --verbose. |
||||
error: could not compile `gui` due to previous error |
||||
|
||||
Loading…
Reference in new issue