Closed
Description
My code is:
#![allow(dead_code)]
#![feature(generators, generator_trait,pin)]
use std::ops::{Generator, GeneratorState};
use std::boxed::PinBox;
use std::pin::Pin;
enum Node<T: Copy>{
Leafs(Option< Box<Node<T>> >,Option< Box<Node<T>> >),
Data(T),
}
impl<T: Copy> Node<T> {
...
}
fn IterateOverTreePreOrder<T: Copy>(trg: Node<T>)->PinBox<impl Generator<Yield=T,Return=()>>{
...
}
...
But this doesn't compile because of:
tema3210@tema2-devhost:~/3kurs_alg_laby/05/rust$ cargo check
Checking rust v0.1.0 (/home/tema3210/3kurs_alg_laby/05/rust)
error[E0432]: unresolved import `std::boxed::PinBox`
--> src/main.rs:4:5
|
4 | use std::boxed::PinBox;
| ^^^^^^^^^^^^^^^^^^ no `PinBox` in `boxed`
warning: unused import: `GeneratorState`
--> src/main.rs:3:27
|
3 | use std::ops::{Generator, GeneratorState};
| ^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `std::pin::Pin`
--> src/main.rs:5:5
|
5 | use std::pin::Pin;
| ^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0432`.
error: could not compile `rust`.
To learn more, run the command again with --verbose.
tema3210@tema2-devhost:~/3kurs_alg_laby/05/rust$ rustc --version
rustc 1.40.0-nightly (4f03f4a98 2019-11-12)
Metadata
Metadata
Assignees
Labels
No labels