Я понятия не имею, почему этот код не может быть скомпилирован с Rust 1.27.0.
Это test.rs на моем жестком диске:
use std::{
self,
io::prelude::*,
net::{ TcpListener, TcpStream },
};
fn main() {}
Вывод при попытке скомпилировать его с rustc test.rs
:
error[E0254]: the name `std` is defined multiple times
--> test.rs:2:5
|
2 | self,
| ^^^^ `std` reimported here
|
= note: `std` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
|
2 | self as other_std,
| ^^^^^^^^^^^^^^^^^
warning: unused imports: `TcpListener`, `TcpStream`, `io::prelude::*`, `self`
--> test.rs:2:5
|
2 | self,
| ^^^^
3 | io::prelude::*,
| ^^^^^^^^^^^^^^
4 | net::{TcpListener, TcpStream},
| ^^^^^^^^^^^ ^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default