You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::collections::BinaryHeap;#[derive(Debug)]pubstructMyStruct{bh:BinaryHeap<i32>,}fnmain(){let m = MyStruct{bh:BinaryHeap::new(),};}
I get the following error :
test.rs:6:2:6:21 error: the trait `core::fmt::Debug` is not implemented for the type `collections::binary_heap::BinaryHeap<i32>` [E0277]
test.rs:6 bh:BinaryHeap<i32>,
^~~~~~~~~~~~~~~~~~~~~~~
test.rs:3:10:3:15 note:inexpansion of #[derive_Debug]
test.rs:3:10:3:15 note: expansion site
test.rs:6:2:6:21 note: `collections::binary_heap::BinaryHeap<i32>` cannot be formatted using `:?`;if it is defined in your crate, add `#[derive(Debug)]` or manually implement it
test.rs:6 bh:BinaryHeap<i32>,
^~~~~~~~~~~~~~~~~~~~~~~
test.rs:3:10:3:15 note:inexpansion of #[derive_Debug]
test.rs:3:10:3:15 note: expansion site
error: aborting due to previous error
I don't see any reason for the trait Debug not to be implemented for BinaryHeap. If seeing the nodes of it is a problem, at least a ByanryHeap[size: x] could be enough.
The text was updated successfully, but these errors were encountered:
Probably an oversight. Implementing the solution shouldn't take more than a line (few at most) and it is annoying that you can't easily implement debug for struct owning one BinaryHeap.
If I run the following code :
I get the following error :
I don't see any reason for the trait Debug not to be implemented for BinaryHeap. If seeing the nodes of it is a problem, at least a
ByanryHeap[size: x]
could be enough.The text was updated successfully, but these errors were encountered: