Rudra not compiling with derive(Default)
matanmarkind opened this issue · 2 comments
matanmarkind commented
For some reason Rudra isn't compiling when I use "derive(Default)" When I implement the Default explicitly I get no such issue. cargo test
compiles & runs just fine either way.
Change to allow Rudra to compile - matanmarkind/active_standby@5108cc5
sudo RUDRA_RUNNER_HOME=~/rust/Rudra/rudra_runner ~/rust/Rudra/docker-helper/docker-cargo-rudra ~/rust/active_standby
2022-02-23 07:08:19.846614 |INFO | [rudra-progress] Running cargo rudra
2022-02-23 07:08:20.837016 |INFO | [rudra-progress] Running rudra for target lib:active_standby
error[E0277]: the trait bound `K: std::cmp::Ord` is not satisfied
--> src/macros.rs:91:13
|
91 | inner: AsLockHandleAlias$(< $($Inner),* >)?,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `K`
|
::: src/collections/btreemap.rs:66:5
|
66 | crate::generate_lockless_aslockhandle!(BTreeMap<K, V>);
| ------------------------------------------------------- in this macro invocation
|
= note: required because of the requirements on the impl of `std::default::Default` for `std::collections::BTreeMap<K, V>`
= note: 1 redundant requirements hidden
= note: required because of the requirements on the impl of `std::default::Default` for `lockless::aslockhandle::AsLockHandle<std::collections::BTreeMap<K, V>>`
note: required by `std::default::Default::default`
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
|
89 | #[derive(Default + std::cmp::Ord, Clone)]
| +++++++++++++++
error[E0277]: the trait bound `T: std::cmp::Ord` is not satisfied
--> src/macros.rs:91:13
|
91 | inner: AsLockHandleAlias$(< $($Inner),* >)?,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `T`
|
::: src/collections/btreeset.rs:78:5
|
78 | crate::generate_lockless_aslockhandle!(BTreeSet<T>);
| ---------------------------------------------------- in this macro invocation
|
= note: required because of the requirements on the impl of `std::default::Default` for `std::collections::BTreeSet<T>`
= note: 1 redundant requirements hidden
= note: required because of the requirements on the impl of `std::default::Default` for `lockless::aslockhandle::AsLockHandle<std::collections::BTreeSet<T>>`
note: required by `std::default::Default::default`
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
|
89 | #[derive(Default + std::cmp::Ord, Clone)]
| +++++++++++++++
error[E0277]: the trait bound `K: std::cmp::Ord` is not satisfied
--> src/macros.rs:205:13
|
205 | inner: AsLockAlias$(< $($Inner),* >)?,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `K`
|
::: src/collections/btreemap.rs:117:5
|
117 | crate::generate_shared_aslock!(BTreeMap<K, V>);
| ----------------------------------------------- in this macro invocation
|
= note: required because of the requirements on the impl of `std::default::Default` for `std::collections::BTreeMap<K, V>`
= note: 1 redundant requirements hidden
= note: required because of the requirements on the impl of `std::default::Default` for `shared::aslock::AsLock<std::collections::BTreeMap<K, V>>`
note: required by `std::default::Default::default`
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
|
203 | #[derive(Default + std::cmp::Ord)]
| +++++++++++++++
error[E0277]: the trait bound `T: std::cmp::Ord` is not satisfied
--> src/macros.rs:205:13
|
205 | inner: AsLockAlias$(< $($Inner),* >)?,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `T`
|
::: src/collections/btreeset.rs:131:5
|
131 | crate::generate_shared_aslock!(BTreeSet<T>);
| -------------------------------------------- in this macro invocation
|
= note: required because of the requirements on the impl of `std::default::Default` for `std::collections::BTreeSet<T>`
= note: 1 redundant requirements hidden
= note: required because of the requirements on the impl of `std::default::Default` for `shared::aslock::AsLock<std::collections::BTreeSet<T>>`
note: required by `std::default::Default::default`
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
|
203 | #[derive(Default + std::cmp::Ord)]
| +++++++++++++++
For more information about this error, try `rustc --explain E0277`.
error: could not compile `active_standby` due to 4 previous errors
2022-02-23 07:08:24.492177 |ERROR| [rudra-progress] Finished with non-zero exit code
Qwaz commented
Given that the code compiles with 1.56 but not with 1.55, the compile error doesn't seem to be caused by Rudra but from the Rust compiler itself. It should be fixed once the underlying compiler version is updated. Closing in favor of #19.
Qwaz commented
This is the commit that removed the Ord
requirement from BTreeMap::default()
rust-lang/rust@f33f266